Skip to content

Commit 706f308

Browse files
committed
Fix useBindKeyToAction cleanup
1 parent 0e8a6ab commit 706f308

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hooks/useBindKeyToAction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function useBindKeyToAction({ keys, action }: UseBindKeyToActionProps) {
1717
window?.addEventListener("keydown", handler);
1818

1919
return () => {
20-
window?.addEventListener("keydown", handler);
20+
window?.removeEventListener("keydown", handler);
2121
};
2222
}, [action, keys]);
2323
}

0 commit comments

Comments
 (0)