Re:Thinking in React Hooks
by andrewstuart on Friday December 13, 2019 @12:39AM
(#21779369)
Does this continuously clearInterval on every render?
[ Parent
| on HN ]
Nope. Since the dep array is empty, the effect only runs once after the first render, & the cleanup function returned from the effect only runs on unmount.
Re:Thinking in React Hooks
by andrewstuart on Friday December 13, 2019 @03:52AM
(#21780108)
I like it. How did I miss this most obvious and simple solution?