fn
useEscapeKey
v0.0.14testeddemoRegister a callback for the topmost Escape keydown. Uses an internal stack so that nested layers (e.g. nested Dialogs) dismiss in the correct order — only the most recently-registered listener fires for a given keydown.
Demo
Loading demo…
Signature
ts
export function useEscapeKey(handler: EscapeListener): VoidFunction{ ... }Parameters
| Parameter | Type | Description |
|---|---|---|
handler | EscapeListener | Callback invoked on the topmost Escape |
Returns
VoidFunctionStop handle that removes the subscription