-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[Bug]: HashRouter: browser's back button and navigate(-1)
not work in some cases
#9966
Comments
Looks like #9709 is causing this, but I have no specific idea why. @chaance or @brophdawg11 might have a better idea than me. |
I think this might be a codesandbox quirk. If I copy that |
Thank you for replying. You're right! I noticed my codesandbox example doesn't reproduce the issue in local. However, it was reproduced on my full app. (The app doesn't try to block navigation.) Perhaps other components or dependencies broke |
Closing for now, but let us know if you can isolate the issue outside of the codesandbox and get us a repro to look at 👍 |
The codesandbox does reproduce this behavior for me, and we also have this in our App after updating to 6.7. Open the codesandbox URL in a new Tab to actually reproduce it, and manually change the URL in the browser addressbar from one route to the other. Navigation will only occur on the second try, and the console will show "You are trying to block a POP navigation" on the first attempt. In my own app, I used this to reproduce it:
Changing the browser address bar from |
Thanks for the reproduction @shartte! |
This should be fixed now in |
Awesome, thanks! |
What version of React Router are you using?
6.7.0
Steps to Reproduce
HashRouter
of [email protected].Expected Behavior
Navigates to the root page.
Actual Behavior
Doesn't navigate.
It isn't reproduced when using [email protected].
The text was updated successfully, but these errors were encountered: