Skip to content
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]: Blocker not working after first navigation #10649

Closed
rothsandro opened this issue Jun 29, 2023 · 2 comments
Closed

[Bug]: Blocker not working after first navigation #10649

rothsandro opened this issue Jun 29, 2023 · 2 comments
Labels

Comments

@rothsandro
Copy link

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.

  1. Open the app at the root route /
  2. Click on router link "One" => route is blocked
  3. Click on "Let met through" => router proceeds
  4. Click on router link "Two" => route is NOT blocked anymore

Reproduction:

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.

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 6.14.1-pre.1 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 6.14.1 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant