Menu

Using requestAnimationFrame with React Hooks

August 21st, 2019

Animating with requestAnimationFrame should be easy, but if you haven’t read React’s documentation thoroughly then you will probably run into a few things that might cause you a headache. Here are three gotcha moments I learned the hard way. TLDR: Pass an empty array as a second parameter for useEffect to avoid it running more…