diff --git a/frontend/src/hooks/useDebounce.ts b/frontend/src/hooks/useDebounce.ts index 990de373..dcf2a2af 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]); };