Web Development
Bug Report
React countdown stuck at 1: stale closure in a setInterval inside useEffect
Our session timeout banner counted from 0 to 1 and then froze. The interval callback captured the first render's state, so it kept computing 0 + 1 forever. Functional state updates, and a ref-based useInterval hook for callbacks that read props, fixed it for good.