Skip to content

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

@rothsandro

Description

@rothsandro

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions