Replies: 1 comment
|
Might've been changes, didn't look too deep but it's now |
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.
Uh oh!
There was an error while loading. Please reload this page.
Currently,
useBlockerwill always add abeforeunloadevent listener, which triggers a blocking alert box when leaving the page or closing the tab. However, there are situations where you might want to block internal navigation but don't want to block unload.This would align it with
react-router's behavior, which recommends users to set their ownbeforeunloadlistener instead.Maybe just a prop like this could make sense to make it backwards compatible?
Looking at the source code it would need to pass the option to the
history's block method, which currently only accepts functions, but I don't know if that also needs to remain backwards compatible. In that case maybe it could be added as a second argument?Edit: Seems like #1790 might solve this issue, adding
disableBeforeUnloadas an option 👍All reactions