Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
andrewstuart
· 6y ago · 0 comments
Does this continuously clearInterval on every render?
Comments
[–]
foolbiter
6y 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.
[–]
andrewstuart
OP
6y ago
I like it. How did I miss this most obvious and simple solution?