Y
Hacker News
new
|
ask
|
show
|
jobs
by
andrewstuart
2380 days ago
Does this continuously clearInterval on every render?
1 comments
foolbiter
2380 days ago
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.
link
andrewstuart
2379 days ago
I like it. How did I miss this most obvious and simple solution?
link