-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change how we handle index routes with nested components #3326
Comments
Looks, good, lets hold off on any sort of utils to make the nesting easier.
This is the nail in coffin for me and nested absolute routes. |
Should we add support for nesting |
cc @danieljuhl, who added this feature in #2330. |
What does this become? <Router history={ history }>
<Route path='/' component={ App }>
<Route path='signup' component={ Signup } />
<Route path='login' component={ Login } />
<Route component={ ListPage }>
<Route path='search' component={ Search } />
<IndexRoute component={ Home } />
</Route>
<Route path='*' name='not-found' component={ NotFound } />
</Route>
</Router> |
Maybe: <Router history={ history }>
<Route path='/' component={ App }>
<IndexRoute component={ ListPage }>
<IndexRoute component={ Home } />
</IndexRoute>
<Route path='signup' component={ Signup } />
<Route path='login' component={ Login } />
<Route component={ ListPage }>
<Route path='search' component={ Search } />
</Route>
<Route path='*' name='not-found' component={ NotFound } />
</Route>
</Router> There's some duplication, but maybe it's more clear? This might be a bit of a harebrained idea on my part. |
Perhaps I misunderstand the intention, but is this really such a problem? Wouldn't it be easier to just use the route components for composition, instead of the router?
|
Yeah exactly, that's what I was thinking when I saw the |
@taurose That's what I was thinking with |
I think @taurose code would still do that, no? |
Doesn't async-props work via a static |
Given the tepid response here, and that this does legitimately make cases like #3326 (comment) harder, I'm going to close this out for now. The sync/async mismatch may be a non-issue once we resolve #3232 and put async child routes before the code split, anyway. |
Currently we support this syntax:
This is a little bit awkward and only works for sync child routes (i.e. it won't work if these child routes were declared via
getChildRoutes
).I'd like to propose changing this API up a bit. A few options:
If we take out nested routes with absolute path support, this would remove the only other inconsistency to my knowledge between the sync and async child route cases.
The text was updated successfully, but these errors were encountered: