🚨 React devs… stop abusing useEffect 😵💫🛑 If your component has 3+ useEffect calls… that’s not “advanced React” 😬 that’s a warning sign ⚠️ For years, we’ve been treating useEffect like: 👉 “Solution to everything” Fetching data? useEffect. Updating state? useEffect. Deriving values? …also useEffect 😵 And then we wonder why: • Bugs feel random 🐛🎲 • Dependencies are confusing 🤯 • Infinite loops appear out of nowhere 🔁😩 Here’s the truth 💡 👉 useEffect is NOT for business logic. It’s for: ✅ Syncing with external systems (API, DOM, subscriptions) 🌐 ✅ Side effects - not state management ⚙️ That’s it. What to do instead 👇 ✨ Derive state directly during render ✨ Use event handlers for user actions ✨ Keep logic inside components - not effects React 19 makes this even clearer: Less need for effects… more predictable code 🧠⚛️ #reactjs #react19 #javascript #frontend #webdevelopment #programming
Both codes are junior.
sorry, your wrong post 🥴
This pro has one issue
Good point on cleanup with AbortController — it solves part of the problem. In practice, I’ve seen cases where adding a requestId / stale response guard helps avoid outdated state updates, especially under rapid interactions. Also, handling loading / feedback states becomes just as important for UX when requests are frequently interrupted. This becomes even more relevant as UIs get more async and AI-driven.
Pro will use a library
Pro max one : don’t fetch data using useEffect 😆