From cb68d8c695b46274cb35ac345f156bfc36b8934e Mon Sep 17 00:00:00 2001 From: Corwin Date: Wed, 5 Jul 2023 21:34:07 +0100 Subject: [PATCH] add depdendency array --- website/src/useOnKeyUp.hook.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/src/useOnKeyUp.hook.ts b/website/src/useOnKeyUp.hook.ts index fd4b3423..ab0e877b 100644 --- a/website/src/useOnKeyUp.hook.ts +++ b/website/src/useOnKeyUp.hook.ts @@ -13,5 +13,5 @@ export const useOnKeyUp = (targetKey: string, callback: () => void) => { return () => { window.removeEventListener("keyup", downHandler); }; - }, []); + }, [callback, targetKey]); };