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
Currently, when none of the routes in a router match the URL, the router sets its top-level props to null which effectively removes everything below it from the DOM. It would be nice in these instances to let users provide a "not found" handler that can essentially show a 404 page. We would only need one such handler per router.
Perhaps the existing API could be altered to include this?
The more I think about this, the more I'm convinced that we don't really need a NotFound handler. Instead, it really comes down to how Router#transitionTo is being called.
If a user is calling transitionTo directly on a Router instance, and the router can't match on the given path, we should throw. Plain as that.
If we're calling transitionTo automatically from a URL change and the router can't match on the current URL, we could print a warning to the console and just leave the state of the router as it is. The next time the URL changes to something that router does recognize, it will update accordingly.
Currently, when none of the routes in a router match the URL, the router sets its top-level props to null which effectively removes everything below it from the DOM. It would be nice in these instances to let users provide a "not found" handler that can essentially show a 404 page. We would only need one such handler per router.
Perhaps the existing API could be altered to include this?
@rpflorence thoughts?
The text was updated successfully, but these errors were encountered: