HN
Hacker News
Top
New
Best
Ask
Show
Jobs
Comment by andrewstuart | Hacker News Reader
Parent
Full thread
andrewstuart
·
Does this continuously clearInterval on every render?
View on HN
foolbiter
·
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.
andrewstuart
·
I like it. How did I miss this most obvious and simple solution?
Reply on news.ycombinator.com