🤔 “Why is my API calling twice?”..... When I first used useEffect, I wrote this: useEffect(() => { fetchData() }, []) I expected it to run once. But in development… it ran twice. 😵 After some digging, I learned something interesting 👇 ⚛️ React Strict Mode If your app is wrapped like this: <React.StrictMode> <App /> </React.StrictMode> React will intentionally run useEffect twice in development. Not a bug. It’s React checking for: • unsafe side effects • missing cleanup logic • unexpected mutations ✅ Important: This only happens in development, not in production builds. So next time your API fires twice… before debugging for hours — check Strict Mode first. React sometimes teaches us things in surprising ways. 🚀 #React #ReactNative #useEffect #SoftwareEngineering
Yes ,interesting , I remembering my those days while working on frontend,one of my senior has told this to me ,,,
Yes, seen this bug when I got started in React, was staring at thescreen forhoursz, only to know it was strictmode issue...