3 ms·
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.
by foolbiter 7y 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 7y agoI like it. How did I miss this most obvious and simple solution?