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.
Store setup
Welcome back. In this video, we are going to take our counter Redux base example and going to convert it into Redux toolkit base example. The first thing is we have to set up a store. The store is going to be responsible for holding all the slices of information which are the pieces of state. In the real-world analogy, it's like a company's main filing cabinet, where all the information from different departments can go inside. For using the Redux Toolkit library, we have to install this package ReduxJS-Toolkit. After that, we have to use this configure store method instead of create store method. So let's get to work. In this example, we first have to simplify a few things. First of all, I'm going to create a folder inside source with the name of components. this, I'm going to create a file counter Redux.tsx, let's change the naming convention, we'll We'll do rafce and now we have to go inside our app.tsx. We have to copy everything from here and inside this component, we can paste…
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)
Introduction and recap: Local state and global state7m 6s
-
(Locked)
useState and useContext: Recap and pitfalls5m 56s
-
(Locked)
Problems solved by global state libraries7m 26s
-
(Locked)
Problems without global state: Summary5m 13s
-
(Locked)
Lifting state up: Recap3m 17s
-
(Locked)
Advanced scenario 1: Multiple dependents6m 46s
-
(Locked)
Advanced scenario 2: Derived state8m 14s
-
(Locked)
Summary2m 8s
-
(Locked)
Context API: Recap4m 48s
-
(Locked)
Best practices2m 48s
-
(Locked)
Performance considerations3m 35s
-
(Locked)
Introduction to Redux5m 6s
-
(Locked)
Setting up Redux project4m 17s
-
(Locked)
Setting up types for action6m 1s
-
(Locked)
Setting up actions for counter6m 18s
-
(Locked)
Setting up reducer for counter6m 52s
-
(Locked)
Setting up Redux store8m 20s
-
(Locked)
Counter component11m 50s
-
(Locked)
Introduction to RTK2m 29s
-
(Locked)
Real-world analogy: Key concepts3m 58s
-
(Locked)
Store setup14m 36s
-
(Locked)
Reducer setup8m 25s
-
(Locked)
Custom hook and component setup11m 4s
-
(Locked)
Plug new store and dev tools demo5m 51s
-
(Locked)
Introduction to async thunk in RTK2m 44s
-
(Locked)
Explanation of code with async thunk and slice5m 8s
-
(Locked)
Fetch users function11m 7s
-
(Locked)
User slice setup7m 19s
-
(Locked)
Users component and demo8m 25s
-
(Locked)
RTK Query: Introduction2m 50s
-
(Locked)
Reselect usage and demo7m 37s
-
(Locked)
Caching and refetching comparison6m 41s
-
(Locked)
useSelector problems7m 22s
-
(Locked)
Generated hooks and example7m 8s
-
(Locked)
Benefits of Reselect1m 39s
-
(Locked)
Custom middleware: Introduction8m 15s
-
(Locked)
Analytic middleware example2m 19s
-
(Locked)
Benefits and summary1m 31s
-
(Locked)
Challenges with large apps2m 42s
-
(Locked)
Domain-based example2m 24s
-
(Locked)
Benefits of structured stores1m 58s
-
(Locked)
Redux alternatives3m 44s
-
(Locked)
Zustand code example8m 15s
-
(Locked)
Jotai code example11m 41s
-
(Locked)
Recoil code example14m 39s
-
(Locked)
Comparison: When to use which3m 17s
-
(Locked)
Introduction to server state management4m 28s
-
(Locked)
TanStack React Query example4m 25s
-
(Locked)
SWR (Stale-While-Revalidate) example3m 18s
-
(Locked)
Comparison between TanStack and SWR4m 34s
-
(Locked)
Project overview6m 27s
-
(Locked)
Project setup and installations5m 13s
-
(Locked)
Store setup and API5m 31s
-
(Locked)
Products list component6m 52s
-
(Locked)
Product card component7m 49s
-
(Locked)
Cart slice8m 48s
-
(Locked)
Cart component19m 5s
-
(Locked)
App component6m 50s
-
(Locked)
Server-side sync5m 12s
-
(Locked)
-