Problem with react router and window.location.hash after 6.7.0 release #9973
Unanswered
poserdonut
asked this question in
Q&A
Replies: 3 comments 1 reply
-
Agreed, this prevents a user from changing route via the url bar. Unfortunately with systems like AWS CloudFront, we're forced to use hash routing. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
After upgrading to react-router 6.7.0 we are no longer able to trigger a location change (useLocation()) by passing a value to window.location.hash. This used to work but now we get the following in the log:
"You are trying to block a POP navigation to a location that was not created by @remix-run/router. The block will fail silently in production, but in general you should do all navigation with the router (instead of using window.history.pushState directly) to avoid this situation."
Which indicates that it's related to this PR #9709
Is there any way we can fall back to the old behaviour where we could modify the window.location.hash and have that trigger a location change?
Beta Was this translation helpful? Give feedback.
All reactions