You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The last route fallback to a not found page (globally)
Unexpected
'/some-path-not-exist' didn't reach the not found page route
The nest '/' route caught every non-existing paths instead, even the path is not existing inside nesting.
Expected
Whether nest prop true of false, should maintain the same expectations
'/some-path-not-exist' path should match the fallback route - <NotFound /> if it's not being strictly matched inside nesting routes.
Suggestions
For example
<Switch><Routepath="/"nest><Routepath="settings"nest><SettingsView><Switch><Routepath="appearance"><AppearanceView/></Route><Route>Not found - You may checkout /settings/appearance</Route></Switch></SettingsView></Route></Route><Route><NotFound/></Route></Switch>;
Would be better:
Match inside not found if '/settings/some-path-not-exist'
Match outside not found if '/some-path-not-exist'
'/settings/language' fallbacks to inside not found (<Route>Not found - You may checkout /settings/appearance</Route>)
'/set' fallbacks to outside
The text was updated successfully, but these errors were encountered:
This feels more like an issue with your application structure and not so much with this lib.
Each nested Route is like a catch all, so if you want a not-found you need to place it inside your nested route with a separate switch. What you want is multi-level matching. React Router implemented something like this, but it comes at the drawback that all routes need to be defined beforehand.
wouter has a more simplistic approach. Switch evaluates each child with a path-prop, and renderes the first match. In this case your main route. If you restructure your examples like this they would work as you expect:
Fallback not found route is a little bit confused with
nest
.Example
<AppPage/>
wraps nested views.<AuthPage/>
contains login form.Unexpected
Expected
nest
prop true of false, should maintain the same expectations<NotFound />
if it's not being strictly matched inside nesting routes.Suggestions
For example
Would be better:
<Route>Not found - You may checkout /settings/appearance</Route>
)The text was updated successfully, but these errors were encountered: