Hacker News new | ask | show | jobs
by throwaway290 985 days 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.)

1 comments

useEffect is the biggest source of bugs in any react codebase bar none