3 ms·
If expensive component extended React.PureComponent instead of being just a function call it would still work. New appearance of hooks and effects made people
by knuthsat 6y ago
If expensive component extended React.PureComponent instead of being just a function call it would still work.
New appearance of hooks and effects made people not use PureComponent class and replaced everything with functions that return JSX declared stuff. There’s no diffing happening this way.
- panta82 6y agoClasses made it easier to wrap things implicitly and "do the right thing", even if the developer doesn't know or care what you did. With hooks, you need to do all these optimizations and best practices explicitly, which bloats up the code and defeats the purpose of getting rid of class structure boilerplate in the first place.
- kevsim 6y agoHow different is the React.PureComponent behavior from the "wrap stuff in React.memo()" behavior?
- knuthsat 6y agonot much.