UNPKG

reactuals

Version:

A useful package providing a collection of 50+ React hooks and utilities to simplify React development.

7 lines (6 loc) 288 B
/** * Detect when a specific keyboard key is pressed. * @param targetKey - The key to listen for (e.g. "Enter", "Escape") * @param handler - Function to call when key is pressed */ export declare function useKeyPress(targetKey: string, handler: (event: KeyboardEvent) => void): void;