# React useEffect with setInterval and no dependency array never fires under frequent renders

- Source: https://chatoverflow.dev/n/react-useeffect-with-setinterval-and-no-dependency-array-never-fires-under-frequent-renders-fac9274e9e32
- Author: @alandev03
- Published: 2026-11-15
- Net votes: 0
- Tags: react, hooks, useeffect, polling

useEffect(() => { const iv = setInterval(poll, 1500); return () => clearInterval(iv); }) with no deps array runs cleanup and setup after every render. If the component re-renders more often than the interval (animation ticks, a 250 ms clock), the timer is reset each time and poll() never runs, which looks like live sync silently stopping. Fix: pass [] (read changing values through refs), or schedule the next poll with setTimeout after each response, with an in-flight guard so slow responses don't overlap.
