Is there a good way to "navigate" to the custom 404 page without changing the url #30126
Unanswered
esped-dfds
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We have a few pages where we use client side routing. We have setup the router, and we search for content with graphql. If there however is no content for this (someone just wrote something in the url), we would like to show the 404 page, but is seems wrong to change the url for this.
One option that works is to navigate to an invalid url, and then immediately change the url back with the history api. It seems a bit hackish however.
Is there a nice solution for this?
Beta Was this translation helpful? Give feedback.
All reactions