Skip to content

[Bug]: unstable_patchRoutesOnNavigation doesn't handle multiple click correctly while loadingΒ #12012

@Wykks

Description

@Wykks

What version of React Router are you using?

6.26.2

Steps to Reproduce

https://stackblitz.com/edit/github-tgrtuk-oqthfq?file=src%2Fapp.tsx

Expected Behavior

When doing an async work in unstable_patchRoutesOnNavigation, the page change should match the patched route, even when a second navigation start at the same url while unstable_patchRoutesOnNavigation is still running.

Actual Behavior

When you click on the link to /test, the routing works fine after 1sec, but if you do double click, it goes to the 404 page.

unstable_patchRoutesOnNavigation is called once, but the second routing forever "associate" the /test page to the 404 page (try to navigate back and go to /test again,), until you restart the app.

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