unstale

npm / react-hotkeys-hook

react-hotkeys-hook

What changed in react-hotkeys-hook 4 to 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-25.

13 breaking15 new APIs and options2 behavior and defaults2 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.6 on npm

react-hotkeys-hook 510 changes

Breaking changes 7

  • The HotkeysProvider context value enabledScopes has been renamed to activeScopes.

    5.0.0upgrade guide

  • The HotkeysProvider option enabledScopes has been renamed to activeScopes.

    5.0.0release notes

  • CommonJS support has been dropped; the package is now ESM-only. Use a bundler to handle conversion if CommonJS is needed.

    5.0.0upgrade guide

  • Special character mappings to the German keyboard layout code have been removed.

    5.0.0release notes

  • useHotkeys listens to physical key codes rather than produced characters by default; useHotkeys('!', callback) no longer works unless useKey is enabled.

    5.0.0upgrade guiderelease notes

  • The option formerly named splitKey is now delimiter and specifies the character that separates different hotkey combinations.

    5.0.0upgrade guiderelease notes

  • The option formerly named combinationKey is now splitKey and specifies the character that joins keys within a combination.

    5.0.0upgrade guiderelease notes

New APIs and options 1

  • Set useKey to true to listen to the produced key rather than the code; it defaults to false.

    5.0.0release notes

Behavior and default changes 1

Fixes and other changes 1

  • Listening to control instead of ctrl now triggers correctly.

    5.0.0release notes

react-hotkeys-hook 422 changes

Breaking changes 6

  • The cmd hotkey is no longer available; use meta instead.

    4.0.0release notes

  • combinationKey replaces splitKey for separating keys in a combination and still defaults to +.

    4.0.0release notes

  • The command hotkey is no longer available; use meta instead.

    4.0.0release notes

  • enableOnFormTags replaces enableOnTags.

    4.0.0release notes

  • filter merges into enabled.

    4.0.0release notes

  • splitKey now separates keystrokes and defaults to ,.

    4.0.0release notes

New APIs and options 14

  • Deactivates the given scope.

    4.0.0release notes

  • enabled accepts a Trigger: a boolean or a function receiving keyboardEvent and hotkeysEvent to determine whether the option should trigger.

    4.0.0release notes

  • Returns the active scopes; defaults to ['*'] for wildcard.

    4.0.0release notes

  • enableOnTags accepts a boolean; true enables all form tags, and the default is false.

    4.0.0release notes

  • Activates the given scope.

    4.0.0release notes

  • Returns an array of all currently bound hotkeys through useHotkeysContext.

    4.0.0release notes

  • Wrap the app in HotkeysProvider to use scopes.

    4.0.0release notes

  • The first argument accepts an array or string to check whether a key or combination of keys is currently pressed.

    4.0.0release notes

  • Accepts a splitKey string to separate hotkeys when the first argument is a string.

    4.0.0release notes

  • preventDefault accepts a Trigger to determine whether to call e.preventDefault() internally; it defaults to false.

    4.0.0release notes

  • Set one or more scopes on a hotkey; the hotkey is active only when a matching scope is activated.

    4.0.0release notes

  • Toggles the given scope.

    4.0.0release notes

  • The first argument can be an array of hotkey strings.

    4.0.0release notes

  • The hook provides functions and values for managing scopes and accessing currently bound hotkeys.

    4.0.0release notes

Behavior and default changes 1

  • The options object and dependency array can be passed in either order, and either can be omitted.

    4.0.0release notes

Fixes and other changes 1

  • The dependency list is now typed as DependencyList instead of any[].

    4.0.0release notes