Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use before unload doesn't stop reload #10

Open
aniket-banyal opened this issue Sep 2, 2024 · 0 comments
Open

Use before unload doesn't stop reload #10

aniket-banyal opened this issue Sep 2, 2024 · 0 comments

Comments

@aniket-banyal
Copy link
Contributor

When user presses reload btn in browser, the handler is fired but the page then gets refreshed. We need to prevent the default event here -

if (desktop?.useBeforeUnload) {

Reference - https://github.com/streamich/react-use/blob/e1d0cd9f7fb2a124a9d46879489abfefdf48d836/src/useBeforeUnload.ts#L13C7-L13C29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant