Why I avoid useEffect For API Calls and use React Query instead
CoderOne
@coderoneAbout
Unlock the world of web development! From beginner-friendly coding tutorials to advanced tips, join us for a journey of turning ideas into interactive digital experiences. Subscribe now for hands-on learning, project walkthroughs, and staying ahead in the dynamic realm of coding. Let's code together and build something extraordinary! Join the developers-friendly newsletter: https://islemmaboud.com/join-newsletter Website: https://islemmaboud.com Github: https://github.com/ipenywis Twitter: https://x.com/ipenywis
Latest Posts
Video Description
If you are like me, always using use effect whenever you need to grab data from an API then wait for it to be fetched and let the React component render it, Well, this is what most people usually do too! Don't surprised cause it's the most obvious way and straightforward way to do it. But we never thought about improving it right? Likely for us, the team behind React Query built this amazing library to solve this problem and simplify our lives as developers. No more effect, the code is simple and maintainable, anyone can read through the code and it handles all the fetching states for you! ⭐ Timestamps ⭐ 00:00 Intro 00:37 Why React query? 01:32 What's wrong with useEffect? 03:53 Same code but in React Query 05:43 So much easier code! 08:06 No need for a global store (aka Redux) 13:35 React Query cache is so smooth 16:30 Mutations makes it simpler ⚡️ Redux Alternatives Repo https://github.com/ipenywis/react-query-useEffect 🧭 Build Login/Register API Server w/ Authentication | JWT Express AUTH using Passport.JS and Sequelize https://youtu.be/VWEJ-GhjU4U 🧭 Turn Design into React Code | From prototype to Full website in no time https://youtu.be/0xhu_vgKZ8k 🧭 Watch Tutorial on Designing the website on Figma https://youtu.be/SB3rt-cQZas 🧭 Watch Create a Modern React Login/Register Form with smooth Animations https://youtu.be/-bll7l-BKQI 🧭 Debug React Apps Like a Pro | Master Debugging from Zero to Hero with Chrome DevTools https://youtu.be/_rnxOD9NKAs 🧭 Master React Like Pro w/ Redux, Typescript, and GraphQL | Beginner to Advanced in React https://youtu.be/M_Oes39FNuk 🧭 Learn Redux For Beginners | React Redux from Zero To Hero to build a real-world app https://youtu.be/_rnxOD9NKAs 🧭 Introduction to GraphQL with Apollo and React https://youtu.be/eCO6MvvRhXk 🐦 Follow me on Twitter: https://twitter.com/ipenywis 💻 Github Profile: https://github.com/ipenywis Made with 💗 by Coderone
You May Also Like
Upgrade to Ultra HD Now
AI-recommended products based on this video

Amazon Fire TV Stick 4K (newest model), streaming device, more than 700,000 movies and TV episodes, supports Wi-Fi 6, watch free & live TV Reducing CO2

Amazon Fire TV Stick 4K Max (newest model), streaming device, supports Wi-Fi 6E, free & live TV without cable or satellite

Philips Hue Bridge - Unlock the Full Potential of Hue - Multi-Room and Out-of-Home Control - Create Automations and Zones - Secure, Stable Connection Won't Strain Your Wi-Fi - Works with Voice, Matter

Anker 332 USB-C Hub (5-in-1) with 4K HDMI Display, 5Gbps - and 2 5Gbps USB-A Data Ports and for MacBook Pro, MacBook Air, Dell XPS, Lenovo Thinkpad, HP Laptops and More
![SAMSUNG T7 4TB, Portable SSD, Grey, up to 1050MB/s, USB 3.2 Gen2, Gaming, Students & Professionals, External Solid State Drive (MU-PC4T0T/AM), Grey [Canada Version]](https://m.media-amazon.com/images/I/91YfRIy7kYL._AC_UL960_FMwebp_QL65_.jpg)
SAMSUNG T7 4TB, Portable SSD, Grey, up to 1050MB/s, USB 3.2 Gen2, Gaming, Students & Professionals, External Solid State Drive (MU-PC4T0T/AM), Grey [Canada Version]
![SAMSUNG T7 Shield 4TB, Portable Solid State Drive, up-to 1050MB/s, USB 3.2 Gen2, Rugged, IP65 Water & Dust Resistant, for Photographers, Creators and Gaming, (MU-PE4T0S/AM), Black [Canada Version]](https://m.media-amazon.com/images/I/61CKrZWOcrL._AC_UL960_FMwebp_QL65_.jpg)
SAMSUNG T7 Shield 4TB, Portable Solid State Drive, up-to 1050MB/s, USB 3.2 Gen2, Rugged, IP65 Water & Dust Resistant, for Photographers, Creators and Gaming, (MU-PE4T0S/AM), Black [Canada Version]



















