New Jan 19, 2026

Why does useEffect run multiple times even with empty dependency array

Libraries, Frameworks, etc. All from Newest questions tagged reactjs - Stack Overflow View Why does useEffect run multiple times even with empty dependency array on stackoverflow.com

I am using useEffect with an empty dependency array , but it runs more than once, my goal is to fetch data from API only when component mounts. why does this happen in React and how can i ensure the API is called only once.

Scroll to top