From fe00f7c2882da38a8f3f25ba0f8a15a52d13c483 Mon Sep 17 00:00:00 2001 From: Ian K Smith Date: Fri, 19 May 2023 11:17:23 -0600 Subject: [PATCH] fix use-interval for strict mode --- src/hooks/use-interval/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/use-interval/index.ts b/src/hooks/use-interval/index.ts index 4df11b8..cd7b2bb 100644 --- a/src/hooks/use-interval/index.ts +++ b/src/hooks/use-interval/index.ts @@ -24,10 +24,10 @@ export function useInterval(effect: EffectCallback, deps: DependencyList, interv }, [...deps]); useEffect(() => { - const id = setTimeout(() => { + const id = setInterval(() => { triggerInterval(); }, interval); - return () => clearTimeout(id); + return () => clearInterval(id); }, [triggerInterval, interval]); const clear = useCallbackConst(() => {