News for hackers. Stuff that matters.
Re:Before You Memo() by knuthsat on Saturday February 27, 2021 @07:11AM (#26284332)
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.

Re:Before You Memo() by kevsim on Saturday February 27, 2021 @01:21PM (#26286857)
How different is the React.PureComponent behavior from the "wrap stuff in React.memo()" behavior?
Re:Before You Memo() by knuthsat on Sunday February 28, 2021 @07:27AM (#26292912)
not much.
Re:Before You Memo() by panta82 on Saturday February 27, 2021 @07:18AM (#26284363)
Classes 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.