-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Aborting Prompt after page refresh does not restore correct location. #5383
Comments
This is already a known deficiency with
So what can be done about this? As noted in the above comment, the Also, just as an FYI, you don't have to include |
Version
4.1.1
Test Case
https://codesandbox.io/s/LXvDvzwX
Note: The sandbox doesn't show the correct behaviour at all. The location never changes back when canceling the prompt. The described behavoir is based on the observed behavior on my local machine.
Fast local setup (<1 min):
create-react-app router-prompt-issue cd router-prompt-issue npm install --save react-router react-router-dom
Edit
index.js
and paste the code:Steps to reproduce
/1
by clicking on the first link.Expected Behavior
The location will be restored after "aborting" to show
/1
again.Actual Behavior
The location in the browser url bar stays at
/
not representing the current location matched by the router.Notes
This problem only occures when you refresh the page before you press the browser back button. If you do not refresh before clicking the browser back button the location changes back to
/1
as expected.The text was updated successfully, but these errors were encountered: