News for hackers. Stuff that matters.
Re:Hooks Considered Harmful by HeyImAlex on Monday March 21, 2022 @11:43AM (#30755360)
To expand on this, many of the things that hooks now make easy were bespoke per-class implementations with details that leaked into every lifecycle hook. Think of how you’d write a chain of useMemo calls in a class component to see just how bad it was.
Re:Hooks Considered Harmful by mb7733 on Monday March 21, 2022 @07:38PM (#30761146)
Why would you need useMemo in a class component? You can just attach a memoized instance of the function to the component