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

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…

Contents