Why does useEffect run multiple times even with empty dependency array
21:56 18 Jan 2026

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.

reactjs react-hooks