router
router copied to clipboard
Issue with `useBlocker` when navigating to route with `beforeLoad` and `redirect`
Describe the bug
There is an issue when using useBlocker when the user tries to navigate to route with beforeLoad with redirect. The user will either see Blocker twice or have the tab unresponding depending on the type of Blocker used.
Your Example Website or App
https://stackblitz.com/edit/tanstack-router-2j52rq?file=src%2Fmain.tsx
Steps to Reproduce the Bug or Issue
Native blocker
- Go to
Editor 1page - Type anything into the input
- uncheck
Use custom blocker - Try to navigate to
Editor 2page - Click
okwhen the blocker appears
Blocker will appear twice in this case
Custom blocker
- Go to
Editor 1page - Type anything into the input
- check
Use custom blocker - Try to navigate to
Editor 2page - Click
yeswhen the blocker appears
the browser will crash in this case
Expected behavior
As a user, the Blocker should only appear once and not crash the browser
Screenshots or Videos
No response
Platform
- OS: Windows 11
- Browser: Arc Browser
- Version: 1.3.2
Additional context
No response