-
Notifications
You must be signed in to change notification settings - Fork 8
Issue: from unknown route to known route not recovering #27
Comments
Hello @fabien! |
By the way, have you considered having the Preferably, it would run after any router assigned
|
Hello @fabien! I actually ran into a bug inside RouterOutlet that got fixed. Thank you very much! However, in your example, I noticed that you are using a wildcard in your parent route path definition. This should not be done because the router will regard this route as suitable for every url. Remember: routes with wildcards should always go to the very bottom after defining routes without them. Fork your example with fixes: https://codesandbox.io/s/svelte-easyroute-simpliest-demo-forked-pofoc?file=/router.js This bug has been fixed in version 3.0.7. As for finding hooks in component exports - this is not planned. |
Hi @lyohaplotinka! Thanks for clarifying this. I was a bit puzzled when I saw my example not work with 3.0.7 anymore, but that explains it then! It would be nice to see some more documented examples of routes (like named views for example). Regarding the hooks in component modules, it's ok. We can do it using beforeEnter I think. |
Please check out: https://codesandbox.io/s/svelte-easyroute-simpliest-demo-forked-8vku7
Without enabling the fallback route (currently commented out), there's no way to gracefully recover from an unknown route. If you click on 'Page Unknown' and then try to load 'Page 2' again, it won't work. The nested outlet remains blank (likely because it isn't there anymore, because
Layout
has been unloaded as well). Going to 'Page 1' first, then to 'Page 2' does work.While you can work around this (using the fallback route), I believe a valid route should recover itself without any special care from the developer.
The text was updated successfully, but these errors were encountered: