Skip to content

Commit

Permalink
Fixed stale state issue in callbacks (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmathew900 authored Nov 21, 2024
1 parent 8258c6a commit db27e1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const useHotKeys = (hotkey, handler, userConfig, externalDocument) => {
const mousetrapInstance = bindHotKey({
mode: memoizedConfig.mode,
hotkey: convertedHotkey,
handler: handlerRef.current,
handler: (...args) => handlerRef.current(...args),
ref,
externalDocument,
});
Expand Down

0 comments on commit db27e1f

Please sign in to comment.