Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
bhollis committed Oct 12, 2023
1 parent 94a1f9e commit 11e11d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/hotkeys/useHotkey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function useHotkey(
}, [id, combo, description, callback, disabled]);

// Remove the hotkey only once the component unmounts
useEffect(() => () => removeHotkeysById(id, combo), [id]);
useEffect(() => () => removeHotkeysById(id, combo), [combo, id]);
}

/**
Expand All @@ -48,7 +48,7 @@ export function useHotkey(
*/
export function useHotkeys(hotkeyDefs: Hotkey[]) {
const id = useId();
useEffect(() => registerHotkeys(id, hotkeyDefs), [hotkeyDefs]);
useEffect(() => registerHotkeys(id, hotkeyDefs), [hotkeyDefs, id]);

// Remove the hotkeys only once the component unmounts
useEffect(() => () => removeHotkeysById(id), [id]);
Expand Down

0 comments on commit 11e11d8

Please sign in to comment.