Why I avoid useEffect For API Calls and use React Query instead

Опубликовано: 09 Октябрь 2022
на канале: CoderOne
221,068
5.7k

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-que...



🧭 Build Login/Register API Server w/ Authentication | JWT Express AUTH using Passport.JS and Sequelize
   • Build Login/Register API Server w/ Authent...  

🧭 Turn Design into React Code | From prototype to Full website in no time
   • Turn Design into React Code | From prototy...  

🧭 Watch Tutorial on Designing the website on Figma
   • I Design a onecolor Website in 1 hour | De...  

🧭 Watch Create a Modern React Login/Register Form with smooth Animations
   • Create a Modern React Login/Register Form ...  

🧭 Debug React Apps Like a Pro | Master Debugging from Zero to Hero with Chrome DevTools
   • Debug React Apps Like a Pro | Master Debug...  

🧭 Master React Like Pro w/ Redux, Typescript, and GraphQL | Beginner to Advanced in React
   • Master React Like Pro w/ Redux, Typescript...  

🧭 Learn Redux For Beginners | React Redux from Zero To Hero to build a real-world app
   • Debug React Apps Like a Pro | Master Debug...  

🧭 Introduction to GraphQL with Apollo and React
   • Introduction to GraphQL with Apollo and React  


🐦 Follow me on Twitter:   / ipenywis  
💻 Github Profile: https://github.com/ipenywis

Made with 💗 by Coderone


На этой странице сайта вы можете посмотреть видео онлайн Why I avoid useEffect For API Calls and use React Query instead длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь CoderOne 09 Октябрь 2022, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 221,068 раз и оно понравилось 5.7 тысяч зрителям. Приятного просмотра!