React Router API Reference
    Preparing search index...

    Function useBeforeUnload

    • Set up a callback to be fired on Window's beforeunload event.

      Parameters

      • callback: (event: BeforeUnloadEvent) => any

        The callback to be called when the beforeunload event is fired.

      • Optionaloptions: { capture?: boolean }

        Options

        • Optionalcapture?: boolean

          If true, the event will be captured during the capture phase. Defaults to false.

      Returns void