Skip to content
aq-ui
Back to HooksHook

Use Before Unload

Open-code aq-ui React hook for Use Before Unload.

Installation

pnpm dlx aq-ui@alpha add use-before-unload

API reference

Client module

Import the parts you need, then jump to an export for its contract.

View full source

Quick start

"use client"

import { useBeforeUnload } from "@/hooks/use-before-unload"

useBeforeUnload

functionSource L5

Open-code aq-ui React hook for Use Before Unload.

function useBeforeUnload(enabled: boolean, message = ""): void
Returns
void

Parameters

NameTypeDefault
enabledboolean—
message?—""

Files

  • hooks/use-before-unload.ts

Source