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
Hello. Is there any "legal" way to replace route component from within onEnter() hook? I'd like to show, for example, a 404 page without redirect, but keeping the same url.
Now it's possible to render 404 from route component, but it requires checking for 404 conditions in every component for every route.
A better way would be to use getComponent and some global state store to communicate which component that should return. And for 404-ish pages, just having a wildcard catch-all route is normally the easiest way to do this.
Hello. Is there any "legal" way to replace route component from within
onEnter()
hook? I'd like to show, for example, a 404 page without redirect, but keeping the same url.Now it's possible to render 404 from route component, but it requires checking for 404 conditions in every component for every route.
Something like:
Now I'm using:
but it looks hackish. Thanks!
The text was updated successfully, but these errors were encountered: