3 ms·
With the addition of `React.memo`, is it still the recommendation from the React team that we only use `React.PureComponent` and `React.memo` in places where we
by ianschmitz 8y ago
With the addition of `React.memo`, is it still the recommendation from the React team that we only use `React.PureComponent` and `React.memo` in places where we profile and identify performance bottlenecks?
I seem to remember reading that adding something like `PureComponent` or implementing `shouldComponentUpdate()` can actually slow things down due to the cost of props/state comparison?
Either way thanks for another great release team! Suspense has me super excited!
- danabramov 8y agoYeah, nothing changed there. If you run checks that are always false then it's wasted time on checking. Brian recently wrote a profiler to help you find where plugging memo is useful: https://reactjs.org/blog/2018/09/10/introducing-the-react-profiler.html https://reactjs.org/blog/2018/09/10/introducing-the-react-pr...
- dbbk 8y agoEvery time I see stuff like this it just makes me think, why does the developer have to care about this? For example take Glimmer, you never have to do `shouldComponentUpdate` or anything like that, it's just maximally performant out of the box.
- deleted 8y ago[deleted]