Child routes with path="/" can't be matched
See original GitHub issueIssue Description
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:
<Route
path="/:tenantName/"
Component={loadable(() => import('./DashboardPage'))}
/>
But this does not:
<Route path="/:tenantName">
<Route
path="/"
Component={loadable(() => import('./DashboardPage'))}
/>
</Route>
Are path
props overrides or are they additive?
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Navigation to child routes gives error "cannot match any routes"
Try this.router.navigate(['/dashboard/profile']);. and change your route as, const appRoutes: Routes = [ { path: '', component: ...
Read more >Cannot match any routes for child paths · Issue #45659 - GitHub
It looks to me that you're missing pathMatch: 'full' in the configuration of the HomeComponent route; effectively hiding the contact-us route ...
Read more >Router tutorial: tour of heroes - Angular
A wildcard route has a path consisting of two asterisks. It matches every URL. Thus, the router selects this wildcard route if it...
Read more >Troubleshooting Angular routing - Medium
List routes with a static path first, followed by an empty path route, which matches the default route. The wildcard route comes last...
Read more >Angular Router: Child Routes, Auxiliary Routes, Master Detail
What we are doing in this initial configuration is to map certain URL paths to Angular components: meaning that if there is a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
okay, that’s totally a bug then. mind if i track it on this issue?
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: