-
Notifications
You must be signed in to change notification settings - Fork 53
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
"page not found" when the matching route is not under the first matching parent #307
Comments
Workaround: list all child routes from all matching parents under one parent and use a custom route action to determine which parent component to render based on a given context: router.setRoutes([
{
path: '/',
action: (context, commands) => {
return shouldRenderLayoutBForTheContext(context)
? commands.component('x-layout-b')
: commands.component('x-layout-a');
},
children: [
{ path: '/a', component: 'x-a' },
{ path: '/b', component: 'x-b' },
]
}
]); |
The workaround for this also prevents using named parameters in the children routes of
Also, when I swapped:
and made
execute first, it matched against |
Right here it will match correctly against |
* test(router): matching child not under first parent Fixes #307
With the routes config below Vaadin Router should render
<x-layout-b><x-b></x-b></x-layout-b>
for the/b
pathname. However, currently it throwsError: [Vaadin.Router] Page not found (/b)
.The text was updated successfully, but these errors were encountered: