News for hackers. Stuff that matters.
Re:Thinking in React Hooks by cmwelsh on Saturday December 14, 2019 @09:42PM (#21794109)
> Yes there are situations where class components provide more intimate control (componentWillUnmount comes to mind since I'm not aware of a hook for that), but are we really optimizing the majority of our code for exceptional cases?

The return value of invoking React.useEffect’s first parameter is a cleanup function which serves this purpose.

Everyone in this thread is ragging on core concepts like useMemo or useEffect. Once you know these core functions, you’ve learned all the magic. Then you can write spells of your own.

There are no comments on this comment yet.