---
title: "Comment by Favourite Jome on \"Understanding useEffect in React\" | Hashnode"
description: "Nice of you to share your understanding of the useEffect hook kpeale 🎉, it was a good read. Though there are some things I&#39;d say weren&#39;t clear, like th"
url: "https://hashnode.com/posts/understanding-useeffect-in-react/63cfc59e868addd9bfe05c7b/comment/63cfeb8d79a109e4ff157569"
---

[Discussion](https://hashnode.com/posts/understanding-useeffect-in-react/63cfc59e868addd9bfe05c7b)

Comment [Understanding useEffect in React](https://hashnode.com/posts/understanding-useeffect-in-react/63cfc59e868addd9bfe05c7b)

[Favourite Jome](https://hashnode.com/@Favourite)

[Jan 24, 2023](https://hashnode.com/posts/understanding-useeffect-in-react/63cfc59e868addd9bfe05c7b/comment/63cfeb8d79a109e4ff157569)

Nice of you to share your understanding of the useEffect hook kpeale 🎉, it was a good read. Though there are some things I'd say weren't clear, like the cleanup function.

Essentially the cleanup function runs when a component unmounts, that is when you leave that component to maybe view another component.

Keep up the good work though, and keep sharing your thought, in no time you'd be a guru at React 🤩

[Kpeale Legbara](https://hashnode.com/@Kpealecodes)

[Jan 24, 2023](https://hashnode.com/posts/understanding-useeffect-in-react/63cfc59e868addd9bfe05c7b/comment/63cfeb8d79a109e4ff157569#reply-63d02fe379a109e4ff1581ac)

Thank you so much for this feedback. I did not know that the cleanup function runs whenever a component unmounts. Infact,, I only knew it for useEffect Hook! Thank you so much, I will read more on it

[Favourite Jome](https://hashnode.com/@Favourite)

[Jan 24, 2023](https://hashnode.com/posts/understanding-useeffect-in-react/63cfc59e868addd9bfe05c7b/comment/63cfeb8d79a109e4ff157569#reply-63d03e8f1acaeae4c9da7b8f)

You're welcome [Kpeale Legbara](https://hashnode.com/@Kpealecodes)
