|
|
|
|
|
by cmwelsh
2381 days ago
|
|
> 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. |
|