From the course: Building UI Components with Storybook: Master React Components and UI Design with Storybook for Better Efficiency
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Fetching data with component mounting in React and error handling
From the course: Building UI Components with Storybook: Master React Components and UI Design with Storybook for Better Efficiency
Fetching data with component mounting in React and error handling
Patience you have Strong you shall become Storybook you will master. Okay. Welcome back. So We looked at our store. We looked at switching from just a basic from some made-up default Tasks that we were writing in the store, which has no real real-world value to actually fetching from database Of course, there's no API key or anything like that, so it's still pretty basic, but the pattern here is very real and very practical. So we use the fetch library thanks to the power of createAsyncThunk, and then we get the data, we return that data, and in our extra reducers we can check status thanks to AsyncThunk with pending, fulfilled, and rejected. And given those different cases, is we can then use a reducer action payload to update the state tasks to our result, essentially, and then handle what happens in pending or rejected. Very good. Very good. Now that we have this, let's start building out our inbox. Our inbox is a component that's going to handle our composite component, which…
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)
Summary of Redux code and mock data from previous section4m 54s
-
(Locked)
Fetching remote API data with storage11m 17s
-
(Locked)
Fetching data with component mounting in React and error handling9m 58s
-
(Locked)
Building a screen component and wrapping React around Redux5m 4s
-
(Locked)
Using service workers in Storybook to build stories with API requests13m 56s
-
(Locked)
Feature updates with complex component pages and screens in Storybook5m 55s
-
(Locked)
Automating tests with interactions in Storybook8m 15s
-
(Locked)
Storybook Playwright automations for testing5m 34s
-
(Locked)
-