---
title: "Comment by SavAnna on \"Do You Really Know UseEffect?\" | Hashnode"
description: "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 prop"
url: "https://hashnode.com/posts/do-you-really-know-useeffect/6133bfb192d0321a99992d54/comment/613cf46d1821961e2551f1b5"
---

[Discussion](https://hashnode.com/posts/do-you-really-know-useeffect/6133bfb192d0321a99992d54)

Comment [Do You Really Know UseEffect?](https://hashnode.com/posts/do-you-really-know-useeffect/6133bfb192d0321a99992d54)

[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.
