Blocker function
Hello dear Tanstack community,
I have a tanstack router application. I have a form in my detail page and different tabs in this detail page. Since different tab resets the form, I used useBlocker in which there is some unsaved changes. It works in between switching page but not rehresing page (F5 when on the page). I decided to consult in here to get some information whether I am on right track or not?

9 Replies
sensitive-blue•2mo ago
what does not work when refreshing?
hilarious-sapphireOP•2mo ago
it still asks me confirmation alert

sensitive-blue•2mo ago
can you create a complete example by forking one of the router stackblitz examples please?
hilarious-sapphireOP•2mo ago
sure
sensitive-blue•2mo ago
maybe this is of relevane here: https://github.com/TanStack/router/issues/3761#issuecomment-2866350934
GitHub
Navigation always blocked with enableBeforeUnload true, even if ret...
Which project does this relate to? Router Describe the bug if enableBeforeUnload is set to true for a blocker it's always blocking browser navigation. Tested in Chrome Your Example Website or A...
hilarious-sapphireOP•2mo ago
definitely, this was my question. Thanks for the exact point to the problem. I was doing stackblitz. Guess it is not needed anymore. Again, thank you
I tested this and worked perfectly.
sensitive-blue•2mo ago
in this issue they mentioned that this should be documented. if you want to help out, you could create a PR to the docs
hilarious-sapphireOP•2mo ago
I will gladly create a PR if the dev in the thread doesnt create one since it is his solution first
sensitive-blue•2mo ago
he just responded so lets wait a bit