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,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])