flâneur — a map of the web's best reading

Making setInterval Declarative with React Hooks — Overreacted

overreacted.io · 3,478 words · saved by 1 readers

How I learned to stop worrying and love refs.

Making setInterval Declarative with React Hooks February 4, 2019 Pay what you like If you played with React Hooks for more than a few hours, you probably ran into an intriguing problem: using setInterval just doesn’t work as you’d expect. In the words of Ryan Florence: I’ve had a lot of people point to setInterval with hooks as some sort of egg on React’s face Honestly, I think these people have a point. It is confusing at first. But I’ve also come to see it not as a flaw of Hooks but as a mismatch between the React programming model and setInterval . Hooks, being closer to the React programmi

Explore this link on the map →

related reading