3 ms·
Ah, the clarity of useEffect(() => { return () => { handleUnmount() } }, [])! How did they manage to live with the ugly componentWillUnmount() { handleUnmount()
by throwaway290 3y ago
Ah, the clarity of useEffect(() => { return () => { handleUnmount() } }, [])! How did they manage to live with the ugly componentWillUnmount() { handleUnmount() } for all those years?
(By the way, don't forget that [] or it does a completely different thing that you never want.)
- yawnr 3y agouseEffect is the biggest source of bugs in any react codebase bar none