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

Google, IBM & Meta Certificates – 40% Off
One Coursera Plus subscription covers most Professional Certificates on Coursera.
Unlock All Certificates
This tutorial shows how to build two reusable custom React hooks with Axios for async/await requests. It demonstrates data fetching, refetching, POST requests, multiple Axios instances, request cancellation, and testing the hooks in example components.

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.