Welcome to A Look at React Hooks, a beginner-friendly series on React Hooks. In this article, let's look at the useEffect Hook. What is useEffect? If you are coming from the class-based React, the useEffect Hook replaces the componentDidMount, compon...

Markdown supported · ⌘↵ to post
Very insightful as always! Looking forward to the next article on this series.
Would like to take this space to present my post on same topic
Hello Victoria Lo, I have a question.
I don't really understand why I should use a cleanup function in useEffect hook, so far all the little projects I've done using React I don't return the cleanup function.
If it's not too much to ask, could you give instances where I really need to return a cleanup function and what are the side effects of not returning a cleanup function?
Amaan Ahmad
Learn by creating. MERN stack dev.
Great article! I was exactly looking for some explanation about
useEffect(), and here I found your article. Thanks for writing it 😊. Followed ✨