-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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]: When using unstable_useBlocker with initial value true, Works on the second transition. #10144
Comments
Reproduced in version There seems to be some kind of memory leak as the In fact we always fall in the condition where the "A router only supports one blocker at a time" warning message is displayed. If you navigate away from a route with a blocker (even if it is inactive) and come back to it, the |
Here is a fork of the official "React Router Navigation Blocking Example" with pnpm-patched dependencies for https://stackblitz.com/edit/github-v1v4kk?file=package.json To illustrate the behaviour described above in my previous post:
You will see in the devtools console that none of the "even" blockers is ever cleaned up and |
Hello! I'm not exactly sure why it happens, but there's a part that's related to the StrictMode mode, which causes a double load of useEffect, and it's affecting the router context |
Double load of
The problem here would be that effect destruction happens after effect has already been called twice |
Yes! Sorry, I expressed myself poorly. In dev mode and strict mode, the double call is the expected behavior. But it seemed to me that there might be some relationship when looking at the console log of having strict mode active vs not having it:
I actually arrived at this issue due to a blocking problem I have in dev but not in prod. |
Taken from here:
In our case, isn't the auto-increment of |
I have the feeling that the |
This should be addressed by #10573 which will be available in the next release ( |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
What version of React Router are you using?
6.8.2
Steps to Reproduce
Expected Behavior
Confirm does pop up when first click.
The "2" link, which is set to true in the middle instead of the default, works as expected.
Actual Behavior
Confirm does pop up when second click.
The text was updated successfully, but these errors were encountered: