Your Name 3 years ago
parent
commit
8a1dc1b2ba
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      src/utils/hooks/useInterval.js

+ 2
- 0
src/utils/hooks/useInterval.js View File

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