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
This is intended - useBlocker prevents navigations and fetchers are explicitly not navigations. What you're seeing is the bubbling of a 404 on the fetcher call to the Error Boundary, and since you haven't specified one it's using the default which is blowing away your UI so it "feels" like it navigates elsewhere but it remains on / the whole time.
Thanks for the detailed answer! My use case involves not a 404 but the loader returning a redirect, should that also be captured using an error boundary then?
What version of React Router are you using?
6.22.3
Steps to Reproduce
(note: I added a beforeunload handler to make 100% sure the issue is not linked to client vs. "real" navigation)
Expected Behavior
useBlocker
prevents the fetcher from submittingActual Behavior
fetcher.submit()
navigates way, potentially losing unsaved data on the pageThe text was updated successfully, but these errors were encountered: