-
Notifications
You must be signed in to change notification settings - Fork 50
Remove render prop in favor of render child #71
Conversation
Codecov Report
@@ Coverage Diff @@
## master #71 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 6 6
Lines 68 68
Branches 11 11
=====================================
Hits 68 68
Continue to review full report at Codecov.
|
Will it works with connected components? const Example = (props) => (state) => (
<h1>{JSON.stringify(state)}</h1> // { some, state } or { match, location } ?
) |
Isn't how Lazy Component works ? The route will only trigger the Child Render (or Route View) function, using Lazy Components (or not) is up to you. <Route path="/">
{ ({ match, location }) => <Example {...props}/> }
</Route> We will basically have 3 kind of components : Basics Components : const Example = (props) => (
<h1>{JSON.stringify(props)}</h1>
) Lazy Components : const Example = (props) => (state) => (
<h1>{JSON.stringify(state)}</h1>
) Routed Components : const Example = (route) => (props) => (state) => (
<h1>{JSON.stringify(route)}</h1>
) |
How do you deal with subroutes? |
@znk This PR is only about the render property. Subroutes will work the same. |
@jorgebucaran I know that HA 2.x is coming soon, but can you status on this PR, please? It could be nice even for a minor version to seamlessly install it with |
@znk In 2.0, |
Possible to publish that version targeting HA 1.2.x ? |
I want to hold that for 2.x. This is technically not blocking, so that's why I am not giving it a high priority. |
I would be happy to merge a PR that removes lazy components from this implementation of the router. |
Now we have Lazy Components we can let user be responsible of using them to prevent computation issues.
Instead of using a render property, this PR add the ability to define route in a more composable way. Only the first child is used as rendered route.