-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add NotFound component and 404 redirect #440
Add NotFound component and 404 redirect #440
Conversation
c4f22be
to
cc40c69
Compare
Since there is now a companion server pull request, I will take this out of draft. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious about whether this works with the MemoryRouter
, since you're directly modifying window.location
. Otherwise seems good.
Good catch @peytondmurray, thanks for the review! |
@peytondmurray, I re-requested your review, could you give this another look when you get a chance? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the revision, I'll merge this now!
Related to conda-incubator/conda-store#899
Description
The basic idea of this pull request is that if the app loads and the user is at some unknown route such as
/conda-store/foo/bar
, the app will forcefully redirect them to/conda-store/not-found
. This redirect should hit the server, which should return this React app along with a 404 HTTP status code. The app will in turn execute at this URL and render a "not found" page.This pull request:
history.pushState()
but an actual refresh of the browser page usingwindow.location.replace()
{urlBasename}/not-found
route matches.Pull request checklist