Hacker News new | ask | show | jobs
by andrewstuart 2380 days ago
Does this continuously clearInterval on every render?
1 comments

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.
I like it. How did I miss this most obvious and simple solution?