You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a page locking navigation on mount, unlocking it on dismount. It could be a form page, locking if form is dirty, unlocking when form is submit (navigate after submit)
After blocker.proceed() I expect navigating to new page without having to confirm twice, even if the page opened do a setSearchParams on mount. because on the second confirmation, my shouldBlock is false, but blocker state is blocking.
Actual Behavior
After confirming navigation (blocker.proceed()) the navigation happen. shouldBlock is false but setSearchParams is blocked, open a new confirmation modal which should be confirmed once again.
Best regards,
The text was updated successfully, but these errors were encountered:
What version of React Router are you using?
6.21.1
Steps to Reproduce
I prepared a whole bug reproduction repository so feel free to use it and tweak it :
https://stackblitz.com/edit/uhn4nr-react-router-useblocker-issue?file=README.md
Expected Behavior
After
blocker.proceed()
I expect navigating to new page without having to confirm twice, even if the page opened do asetSearchParams
on mount. because on the second confirmation, my shouldBlock is false, but blocker state is blocking.Actual Behavior
After confirming navigation (
blocker.proceed()
) the navigation happen. shouldBlock is false but setSearchParams is blocked, open a new confirmation modal which should be confirmed once again.Best regards,
The text was updated successfully, but these errors were encountered: