T
TanStack15mo ago
stormy-gold

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
Navigation Blocking doesn't work with browser's back button. · Issu...
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...
3 Replies
protestant-coral
protestant-coral15mo ago
MDN Web Docs
Window: confirm() method - Web APIs | MDN
window.confirm() instructs the browser to display a dialog with an optional message, and to wait until the user either confirms or cancels the dialog.
protestant-coral
protestant-coral15mo ago
protestant-coral
protestant-coral15mo ago
as similar hook should be possible in @tanstack/router

Did you find this page helpful?