JavaScript wrangler.
Check out my books!
Web API Cookbook:
https://www.amazon.com/Web-API-Cookbook-JavaScript-Applications/dp/1098150694
Modern CSS:
https://www.amazon.com/dp/148426293X
useEffect is not quite equivalent to componentDidMount, it's a different mental model. See this article for a good explanation.
It's also worth noting that the cleanup from useEffect is not only run when the component is unmounted, but also every time the effect runs again when a dependency changes, the cleanup function returned by the previous effect will be run.
Hi Joe, thanks for sharing this react training post certainly my explanation about the useEffect and it's class methods equivalents it's not the best so I unpublished this post to fix it. 🙂
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
useEffect
is not quite equivalent tocomponentDidMount
, it's a different mental model. See this article for a good explanation.It's also worth noting that the cleanup from
useEffect
is not only run when the component is unmounted, but also every time the effect runs again when a dependency changes, the cleanup function returned by the previous effect will be run.Hi Joe, thanks for sharing this react training post certainly my explanation about the useEffect and it's class methods equivalents it's not the best so I unpublished this post to fix it. 🙂