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