News for hackers. Stuff that matters.
Re:Optimizing React Rendering by o_____________o on Thursday May 25, 2017 @01:18PM (#14418644)
> If we recommended that PureComponent be used everywhere, it would probably be the default already.

> Instead, we'd suggest you be conscious of where you need to do the comparisons.

I'm not following, wouldn't that mean PureComponent by default and opt-in specialized checks when needed?

Re:Optimizing React Rendering by abritinthebay on Thursday May 25, 2017 @02:17PM (#14419036)
No, because PureComponent does have a check.

His point is that you don't always need that check - that check has overhead too!

Basically PureComponent is just a specialized case of shouldComponentUpdate so it's better practice to be mindful of where you're calling that anyhow.

It's also why there's the push to use stateless functions (when you can) because the kind of pseudo micro-optimization that PureComponent actually is can have counter-intuitive consequences.