Skip to content

Use before unload doesn't stop reload #10

@aniket-banyal

Description

@aniket-banyal

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions