-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Description
What version of React Router are you using?
6.8.0
Steps to Reproduce
Minimal test case at https://stackblitz.com/edit/react-ts-gphlmg?file=App.tsx
- Navigate to ‘foo’ or ‘bar‘ using the link on the page
- Use browser back button to navigate back to the ‘index’
- Use the browser forward button to navigate to ‘foo’ or ‘bar’ again
NB. Using only the links on the page works as expected without any warnings in the console.
Expected Behavior
There should (probably?) be no warnings in the console in this simple use case. Nothing is actively blocked and no navigation outside of the router happens (unless using the browser's back/forward button is considered navigation outside of the router).
Actual Behavior
The following warning is logged in the console:
You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via
window.history.pushState/window.location.hashinstead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.