Custom blocker component
Hey, I saw on the docs that it is possible to use custom UI for useBlocker, but I’m not sure how this would be implemented. Does anyone have an example?
3 Replies
like-gold•16mo ago
There's an open PR exploring this pattern https://github.com/TanStack/router/pull/1649 but for now you have to roll your own hook, as the current useBlocker doesn't handle custom UI
GitHub
feat(react-router): improve the blocker functionality for use with ...
We were talking about this on discord, trying to find a handy way to display custom UI when blocking navigation.
I adapted a bit @freshgiammi's first draft and expanded it to the Blocker compon...
noble-goldOP•16mo ago
That’ll help a ton, thanks!
fascinating-indigo•16mo ago
please also comment on the PR if you have feedback