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.
> 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?