3 ms·
Yeah I felt the same way about the first one. Yeah we're preventing re-renders there but what are we really preventing / saving, nothing significant? Anytime
by duxup 6y ago
Yeah I felt the same way about the first one.
Yeah we're preventing re-renders there but what are we really preventing / saving, nothing significant?
Anytime I run into a situation where I didn't like how / when a component was re-rendering, it absolutely was not because there was a random bit of state like a counter was in state that didn't need to be... usually it was just a more complex situation unfolding.
It's a good illustrative example, but not a 'common mistake' IMO.