3 ms·
More generally, one should be destructuring object properties (since he later did that anyways) at the top of the function. It's no more typing, but isolates pr
by PKop 7y ago
More generally, one should be destructuring object properties (since he later did that anyways) at the top of the function. It's no more typing, but isolates property usage to one spot. Then pass them into the dependency array.
Seems very convoluted to do that inside the useEffect, just to show how "it doesn't work".
Especially because often a re-run of the effect will be desirable when some of the props change, not always the whole bag..