3 ms·
These are good points, but the examples are an oversimplification and can present problems if overlooked. In the examples, if a function is only ever called wi
by kin 6y ago
These are good points, but the examples are an oversimplification and can present problems if overlooked.
In the examples, if a function is only ever called within one hook callback, it should just be defined in that hook callback. Doing so would expose what you're missing in your dependency array.