-
- Notifications
You must be signed in to change notification settings - Fork 10.7k
Closed
Labels
Description
What version of React Router are you using?
6.14.0
Steps to Reproduce
I have a simple app with a root route /
and some child routes. The root route renders the <Layout />
component with an outlet and a Blocker
component that uses the unstable_Blocker
hook to block all navigations.
- Open the app at the root route
/
- Click on router link "One" => route is blocked
- Click on "Let met through" => router proceeds
- Click on router link "Two" => route is NOT blocked anymore
Reproduction:
- https://github.com/rothsandro/repro.react-router-blocker
- https://stalwart-souffle-2d12e5.netlify.app/
Expected Behavior
Every navigation should be blocked, not just the first one, as the blocker function always returns true
.
Actual Behavior
Only the first navigation is blocked. After proceeding with the first blocked navigation, no other navigation is blocked and the blocker also never calls the shouldBlock
function again.
yeahga, borisvorobev and brophdawg11