3 ms·
Dan had a good summary of why hooks happened which I can't find now, the tldr was that there was a bunch of bugs introduced around referenced props/state being
by vanjajaja1 4y ago
Dan had a good summary of why hooks happened which I can't find now, the tldr was that there was a bunch of bugs introduced around referenced props/state being stale and unpredictable in components. Hooks was the natural evolution that removed all possibility of accidentally referencing stale data.
- joshribakoff 4y ago> Hooks was the natural evolution that removed all possibility of accidentally referencing stale data. It unfortunately does not, you can hve various foot guns with refs or omitting dependencies from the array argument; but to your point it makes it a lot easier to ensure you do it correctly by collocating logic related to each cross cutting concern instead of entangling the code in the lifecycle methods. More precisely it makes it easier to follow correct patterns, but as always that is subjective and hooks can be contentious :)