Amy Blankenship
Jun 16, 2022

--

I would strongly caution against using useMount/useUnmount. The whole point of the way unmounting works in useEffect is to be able to run a function that has access to the function closure as it existed the last time that particular useEffect was called. But this list is a great example of why hooks are a bad idea in general. So easy to misuese.

--

--

Amy Blankenship
Amy Blankenship

Written by Amy Blankenship

Full Stack developer at fintech company. I mainly write about React, Javascript, Typescript, and testing.

Responses (1)