From bca16388b8ee3309269b64f1f1fca02da490de49 Mon Sep 17 00:00:00 2001 From: feb-dain Date: Thu, 16 Nov 2023 15:55:14 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20useDebounce=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [#927] --- frontend/src/hooks/useDebounce.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/hooks/useDebounce.ts b/frontend/src/hooks/useDebounce.ts index 990de3738..dcf2a2af1 100644 --- a/frontend/src/hooks/useDebounce.ts +++ b/frontend/src/hooks/useDebounce.ts @@ -1,11 +1,11 @@ import { useEffect, useCallback } from 'react'; export const useDebounce = (func: (param: T) => void, dependencies: string[], delay: number) => { - const callback = useCallback(func, dependencies); + const callback = useCallback(func, [delay]); useEffect(() => { const timeout = setTimeout(callback, delay); return () => clearTimeout(timeout); - }, [callback, delay]); + }, [callback, dependencies]); };