---
title: "Discussion on \"Do You Really Know UseEffect?\" | Hashnode"
description: "Discussion on \"Do You Really Know UseEffect?\". A guide for you to use React's useEffect Hooks properly. Effects with cleanup and non-cleanup are briefly explained with examples in the article."
url: "https://hashnode.com/posts/do-you-really-know-useeffect/6133bfb192d0321a99992d54"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Do You Really Know UseEffect?](https://blog.theashishmaurya.me/do-you-really-know-useeffect?utm_source=hashnode&utm_medium=feed)

A guide for you to use React's useEffect Hooks properly. Effects with cleanup and non-cleanup are briefly explained with examples in the article.

Sep 4, 2021 · 4 min read · blog.theashishmaurya.me  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#functions](https://hashnode.com/tag/functions)
-   [#frontend-development](https://hashnode.com/tag/frontend-development)

## Written by

[Ashish maurya](https://hashnode.com/@theashishmaurya)

@theashishmaurya · India

  
[View profile](https://hashnode.com/@theashishmaurya)

Hey there!! wanna learn something new?

I am a developer from India with a good eye for frontend logic and design. I am also well acquainted with the backend and business logic so that's add to my ability to create a good frontend while making it easily integratable with backend.

## Responses 4

Markdown supported · ⌘↵ to post

[SavAnna](https://hashnode.com/@SavAnna)

[Sep 11, 2021](https://hashnode.com/posts/do-you-really-know-useeffect/6133bfb192d0321a99992d54/comment/613cf46d1821961e2551f1b5)

Hello Ashish, I have a question. Do I need to use UseEffect when I have something like this: const \[name, setName\] = useState(props. data. name) Here, from proprs I get the fetched data from a database... For example, when I console.log(name), it shows the data two times. Thank you in advance. Anna

[Ashish maurya](https://hashnode.com/@theashishmaurya)

[Sep 12, 2021](https://hashnode.com/posts/do-you-really-know-useeffect/6133bfb192d0321a99992d54/comment/613cf46d1821961e2551f1b5#reply-613e05ed1821961e25520751)

Hey Anna if you are fetching the data from the database when the component mounts, that's when you use the useEffect hook but in your case, the data is being passed as a prop to the component where I don't see any point of using the useEffect.

Do let me know if it helps or if you still have any issues. I would love to help.

[Amit Sharma](https://hashnode.com/@Amit333)

[Sep 6, 2021](https://hashnode.com/posts/do-you-really-know-useeffect/6133bfb192d0321a99992d54/comment/613620c0766bb761a2380262)

Nice explanation...I can understand it clearly

[Ashish maurya](https://hashnode.com/@theashishmaurya)

[Sep 6, 2021](https://hashnode.com/posts/do-you-really-know-useeffect/6133bfb192d0321a99992d54/comment/613620c0766bb761a2380262#reply-61362549766bb761a2380354)

Thank you for your feedback.

[Sneha Maurya](https://hashnode.com/@SnehaMaurya)

[Sep 5, 2021](https://hashnode.com/posts/do-you-really-know-useeffect/6133bfb192d0321a99992d54/comment/6134860f489de51a6a7af331)

understanding basic are very critical , thanks for explaining in such way.

[Ashish maurya](https://hashnode.com/@theashishmaurya)

[Sep 5, 2021](https://hashnode.com/posts/do-you-really-know-useeffect/6133bfb192d0321a99992d54/comment/6134860f489de51a6a7af331#reply-6134888592d0321a99993c67)

I am really glad you find it informative.

[Heaust](https://hashnode.com/@heaust)

[Sep 5, 2021](https://hashnode.com/posts/do-you-really-know-useeffect/6133bfb192d0321a99992d54/comment/613454f192d0321a999935e0)

Absolutely brilliant, phenomenal!!!

[Ashish maurya](https://hashnode.com/@theashishmaurya)

[Sep 5, 2021](https://hashnode.com/posts/do-you-really-know-useeffect/6133bfb192d0321a99992d54/comment/613454f192d0321a999935e0#reply-613475f4489de51a6a7af13b)

Thank you very much [heaust](https://hashnode.com/@heaust). I am happy that you liked it.
