Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Use Axios with React Hooks for Async-Await Requests

Dave Gray via YouTube

Overview

Learn how to create custom React hooks with Axios for handling asynchronous requests in this comprehensive tutorial. Explore the process of building two custom hooks, useAxios and useAxiosFunction, to efficiently manage CRUD operations. Discover how to implement an Axios instance, work with request configurations, and utilize the AbortController for improved performance. Follow along as the instructor demonstrates practical applications through the creation of Joke and Posts components. Gain insights into testing the custom hooks, adding refetch functionality, and debugging common issues. By the end of this tutorial, master the integration of Axios with React hooks for seamless async/await requests in your web applications.

Syllabus

Intro
Welcome
Install Axios
useAxios hook
Request Config
useAxios continued
AbortController - not isMounted
useAxios completed
Create an Axios instance
Joke component
Testing useAxios
Add refetch to useAxios
Testing refetch
useAxios vs useAxiosFunction
useAxiosFunction
Create a 2nd Axios instance
Posts component
Quick debug
Testing useAxiosFunction

Taught by

Dave Gray

Reviews

Start your review of Use Axios with React Hooks for Async-Await Requests

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.