From the course: Build Modern Web Apps with React, Hooks, State Management, and APIs Using Vite or Next.js
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Loading and error UI patterns
From the course: Build Modern Web Apps with React, Hooks, State Management, and APIs Using Vite or Next.js
Loading and error UI patterns
Hello and welcome to lesson number three of this course. In this lesson, we are going to understand how and why we should handle loading and error states and how we can do that gracefully. We discussed this question in the previous lesson as well that why the handling of loading and error states are necessary. Let's take a deep dive into that now. The good user experience is directly equal to a clear feedback going to the user. At each button click or at each event, user is aware what's happening behind the scenes. Whenever we are fetching data from an API, it's very important to show the user a loader Whenever you are calling an API means something is going behind the scenes. So user can get to know that something is getting processed. And if there is an error response coming back from the API, then we should catch the error and we should show the user that what actually went wrong. A bad user experience example can be when your component is stuck for 5 seconds or more and user has…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
(Locked)
Overview and fetch API example8m
-
(Locked)
Axios installation and example6m 21s
-
(Locked)
Setting up Axios client8m 32s
-
(Locked)
Setting up Axios interceptors3m 37s
-
(Locked)
Comparison and summary3m
-
(Locked)
GET requests5m 1s
-
(Locked)
Deep understanding of fetch and Axios7m 13s
-
(Locked)
Loading and error UI patterns4m 16s
-
(Locked)
Enhancing the loading state with loader component3m 16s
-
(Locked)
Enhancing the error state with error component3m 35s
-
(Locked)
Skeleton loader6m 23s
-
(Locked)
Summary54s
-
(Locked)
Why useEffect matters: Overview2m 25s
-
(Locked)
Correct ways of dependency management5m 4s
-
(Locked)
Handling race conditions12m 36s
-
(Locked)
Mistakes to avoid: Summary2m 7s
-
(Locked)
CRUD operations: Introduction4m 45s
-
(Locked)
Project setup overview3m 19s
-
(Locked)
Fetching products: GET3m 14s
-
(Locked)
Adding a product: POST4m 26s
-
(Locked)
Updating a product: PUT5m 35s
-
(Locked)
Deleting a product: DELETE2m 8s
-
(Locked)
Combining everything as an SPA5m 55s
-
(Locked)
Common mistakes: Practices and summary4m 47s
-
(Locked)
Advanced API integration: RTK and TanStack recap3m 8s
-
(Locked)
Recap: UseQuery fetching data using TanStack Query3m 55s
-
(Locked)
Recap: Mutation and optimistic updates with TanStack Query2m 18s
-
(Locked)
Key benefits and summary2m 27s
-
(Locked)
Project overview and setup4m 57s
-
(Locked)
API client setup10m 8s
-
(Locked)
Fetching all posts7m 45s
-
(Locked)
Creating a new post6m 10s
-
(Locked)
Updating a post5m 30s
-
(Locked)
Deleting a post7m 43s
-
(Locked)