Why setInterval/setTimeout gets an old state or reference in react components.
Why setInterval/setTimeout gets an old state or reference in react components. Avoid reading states inside closure.
Updating state directly within a setInterval callback in React components c...