Skip to content

useHotkey

useHotkey(opts): void

Defined in: react/components/overlay/hotkey-palette.tsx:33

Register a hotkey for the lifetime of the component. The handler is read through a ref, so it can close over fresh state without re-registering.

useHotkey({ key: "ctrl+s", name: "Save", group: "File", handler: save });

HotkeyOptions

void