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