From 8393e4a62aab443b3273ecac94cfe60e8b47fb7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Faruk?= Date: Wed, 26 Jun 2024 01:22:26 +0300 Subject: [PATCH] fix: typo --- src/hooks/useInterval.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hooks/useInterval.js b/src/hooks/useInterval.js index 7f4603f..9e998bc 100644 --- a/src/hooks/useInterval.js +++ b/src/hooks/useInterval.js @@ -1,11 +1,11 @@ import { useEffect, useRef } from 'react'; export default function useInterval(callback, delay) { - const callbacRef = useRef(); + const callbackRef = useRef(); // update callback function with current render callback that has access to latest props and state useEffect(() => { - callbacRef.current = callback; + callbackRef.current = callback; }); useEffect(() => { @@ -14,7 +14,7 @@ export default function useInterval(callback, delay) { } const interval = setInterval(() => { - callbacRef.current && callbacRef.current(); + callbackRef.current && callbackRef.current(); }, delay); return () => clearInterval(interval); }, [delay]);