-
Notifications
You must be signed in to change notification settings - Fork 55
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
Child routes with path="/" can't be matched #237
Comments
The result of [
{
children: [
{
path: '/:tenantName',
children: [
{
children: [
{
path: '/:tenantName/'
}
]
}
]
}
]
},
] Yet I receive no children when I visit a url with the nested config. |
So this works, verifying that
https://acme.com/mytenant/dash It seems like the router is bailing out before traversing to my |
Yes, they're additive. The intent was that for the sake of understandability (and also not traversing the entire route tree every time), that it didn't make a lot of sense for children to match if their parents didn't. Note that you can have path-less routes, though, so you can write the above as something like: <Route Component={MainComponent}>
<Route path="/:tenantName" />
<Route
path="/"
Component={loadable(() => import('./DashboardPage'))}
/>
</Route> |
Thanks @taion - I verified they are additive, but my nested |
what happens if you just omit |
That does work - thanks! Seems a bit strange at first glance but perhaps understandable since it is the exact same as the parent. |
i suspect what doing |
Trailing slash didn't work. I tried that above. If nested I can work with the omitted |
okay, that's totally a bug then. mind if i track it on this issue? |
NP, we can reopen if you like, I just want to help avoid clutter. |
I'm looking to group a very large amount of routes under a multi-tenant context such as https://acme.com/mytenant
This url should pull
tenantName = mytenant
and hit the/
Route
.This works fine:
But this does not:
Are
path
props overrides or are they additive?The text was updated successfully, but these errors were encountered: