DEV Community

Discussion on: React useEffect fetching API

Collapse
 
miketalbot profile image
Mike Talbot ⭐ • Edited

That fetch is going to happen 2x at the start. The first time when todos is [] and then it will happen again when it's the result of the fetch as the useEffect deps will have changed. Then actually doesn't it just keep going because the object is different in todos?

Collapse
 
shubhamtiwari909 profile image
Shubham Tiwari

I am still learning so don't know much about in detail for now

Collapse
 
rbluena profile image
Rabii Luena

I admire you on the fact that you are still learning but you still want to each others from what you have learned so far. That is a winning attitude right there. I wanted to help but LUKE already did.

Thanks for sharing.

Thread Thread
 
shubhamtiwari909 profile image
Shubham Tiwari

Thank you