Your Name 3 лет назад
Родитель
Сommit
8a1dc1b2ba
1 измененных файлов: 2 добавлений и 0 удалений
  1. 2
    0
      src/utils/hooks/useInterval.js

+ 2
- 0
src/utils/hooks/useInterval.js Просмотреть файл

@@ -8,6 +8,8 @@ export default function useInterval(fn, delay) {
8 8
   callbackRef.current = fn;
9 9
 
10 10
   useEffect(() => {
11
+    if (delay === undefined || delay === null) return;
12
+
11 13
     const ticker = setInterval(() => callbackRef.current(), delay)
12 14
     return () => clearInterval(ticker)
13 15
   }, [delay])