TanStackT
TanStack2y ago
3 replies
living-lavender

Blocker does not guard browser back like react-router

Loving the way the router works ❤️

We are currently migrating from react-router and has the mentioned issue since we need to guard the back button (crucial for us). (Works in react router)

I was just wondering what the difference between how react-router is since there it works as one might expect there?

Please see https://codesandbox.io/p/sandbox/react-router-6-use-prompt-use-blocker-17r2f?file=%2Findex.js


Link to my github comment: https://github.com/TanStack/router/issues/701#issuecomment-2178590737
GitHub
Describe the bug Navigation blocking works with Link or useNavigate but doesn't work with browser's back button. So if someone go back using back button, blocking is being surpassed. Your E...
Navigation Blocking doesn't work with browser's back button. · Issu...
Was this page helpful?