Vigyata.AI
Is this your channel?

React 19.2 Finally Fixes useEffect (for once)

2.1K views· 83 likes· 9:41· Oct 17, 2025

🛍️ Products Mentioned (7)

#nextjs #react #javascript #webdevelopment #typescript React 19.2 just introduced a powerful new hook - useEffectEvent that finally fixes the most common useEffect problems: infinite re-renders, stale closures, and dependency array chaos. In this video, I’ll show real-world examples, explain how useEffectEvent works, and walk through when (and when not) to use it in your React 19.2 projects. 🔥 Cheatsheet for useEffectEvent: https://dub.sh/useeffectevent-cheatsheet 🚀 Build real-world apps with Next.js like a pro!: https://dub.sh/nextjscourse 🔥 BONUS: Grab my Free Next.js Hot Tips Course and level up instantly: https://bit.ly/nextjshottips use-cache blog post: https://dub.sh/use-cache-nextjs What to watch next: https://youtu.be/vg0KOq0dHIo?si=xNxUUxWNLv7M2vKN https://youtu.be/8K33AlmvqNQ?si=lOdqzGp149MHDXFH ⏰ Timeline 00:00 The React Hook That Fixes useEffect 😳 00:38 Why useEffect Keeps Breaking Your App 01:10 React 19.2’s Secret New Hook - useEffectEvent 02:05 Chat App Gone Wrong 💬 (Real Example) 03:25 The Dependency Array Trap 04:55 How useEffectEvent Actually Works 06:10 Before vs After Demo 🔥 07:40 Fresh State, Stable Effect Finally! 09:00 You Don’t Need useRef or useCallback Here 10:25 When to Use useEffectEvent (And When NOT To) 11:55 Real-World useEffectEvent Use Cases 13:15 React 19.2 Takeaways & Pro Tips 14:45 Grab the Free useEffectEvent Cheat Sheet 📘 🔗 RESOURCES: 💌 Frontend Newsletter: Frontend Snacks 🍿 https://dub.sh/frontend-snacks If you liked this video, you will also love my newsletter Frontend Snacks. You will learn a new topic each week with cool visuals and snippets, the latest frontend news and behind-the-scenes exclusive updates that I don't share anywhere else. ✨ FREE Goodies: https://kulkarniankita.com/goodies ☎️ Book a 1:1 coaching session with me Opened a few coaching calls, grab them before they are gone: https://bit.ly/30mins-coaching-with-ankita 🐤 Find me here Twitter: https://twitter.com/kulkarniankita9/ LinkedIn: https://www.linkedin.com/in/kulkarniankita/

About This Video

How many times have you silenced the ESLint warning just to make a useEffect work… and then somehow ended up in an infinite re-render loop? In this video, I break down the new React 19.2 hook, useEffectEvent, and why it finally fixes the most common useEffect pain: stale closures, dependency array chaos, and effects re-running for reasons that have nothing to do with the actual side-effect. I walk you through a real chat app example where toggling dark/light mode keeps reconnecting the chat. The connection should not restart just because the theme changed—but because theme is referenced inside the effect (for a toast), it gets forced into the dependency array, and now the effect re-runs. With useEffectEvent, I extract that “non-reactive” logic (like reading the latest theme for a toast) into an Effect Event, so the effect stays stable and only re-connects when it actually should (like when roomId changes). My takeaway: treat Effect Events like event handlers you trigger from effects. Use them to break the chain between “this effect must re-run” and “this callback needs fresh state.” And don’t use it as a band-aid—if the logic doesn’t belong in an effect, fix the logic instead of wrapping everything just to silence ESLint.

Frequently Asked Questions

🎬 More from Ankita Kulkarni