Skip to content

Commit

Permalink
make sure only memoisedCallback is unbound
Browse files Browse the repository at this point in the history
  • Loading branch information
godspeedelbow authored Sep 6, 2019
1 parent 11e6cce commit f2c28a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export function useHotkeys(keys: string, callback: CallbackFn, deps: any[] = [])
useEffect(() => {
hotkeys(keys, memoisedCallback);

return () => hotkeys.unbind(keys);
return () => hotkeys.unbind(keys, memoisedCallback);
}, [memoisedCallback]);
}

0 comments on commit f2c28a8

Please sign in to comment.