Replies: 1 comment
-
A workaround is to use
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We use react router to handle navigation. Some UIs have a tabbed view where the tab state is stored in the URL. The user might make changes on one tab, go to another tab, make some more changes and then save changes.
We don't want users to lose changes accidentally by navigating away. We explored using
usePrompt
for this, and while it stops them navigating away accidentally it also stops us switching tabs.It would be useful to be able to have a callback function check whether the navigation should be blocked or not, maybe based on some state that the navigator has at the time, e.g. where it is trying to navigate to.
This seems very similar to #7926, but that issue was closed when these methods were temporarily removed from V6.
Beta Was this translation helpful? Give feedback.
All reactions