3 ms·
This is great, but he could have gotten all of this memoization for free if he hadn’t switched from class based to function based components. Still, very helpf
by Aeolun 5y ago
This is great, but he could have gotten all of this memoization for free if he hadn’t switched from class based to function based components.
Still, very helpful to introduce people to all the important concepts for hook based React.
- ioseph 5y agoHow so? My understanding is you'd still need to implement shouldComponentUpdate in the class component.
- dandelany 5y agoYou can just use PureComponent instead of implementing shouldComponentUpdate, but you're right that it doesn't come "for free". PureComponent : class components :: memo : function components