kit
    Preparing search index...

    Type Alias UseNavigateAwayHandler

    UseNavigateAwayHandler: (event: BeforeUnloadEvent) => string | boolean

    Type Declaration

      • (event: BeforeUnloadEvent): string | boolean
      • Parameters

        • event: BeforeUnloadEvent

        Returns string | boolean

        A custom error message (most browser will ignore it), or just a boolean to signal whether we want to prompt the user

        We might instead return an array with the above as first element and two callbacks, but the callback technique is too cumbersome and unreliable probably: 2) A callback on confirmed leaving 3) A callback on cancel, user stays on page