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.

Setting up Redux store

Setting up Redux store

Now, we are going to set up in this video our store. We did all the steps in backward position because usually what we do is that we set up a store, then we set up the action, then we have our reducers and then finally we get to have our component. But I did that in backward position. So you get a better understanding of how to break down and think of Redux while having a peace of state in your mind. So everything is not going to work until or unless we set up a Redux store. So that is usually the first step. So we are going to set up our Redux store. In that, we are going to define that we have one piece of state, which is named as counter. And for that state, we are going to provide it and plug it with the reducer. Let's quickly do that. And I'll give you the understanding of this inside our code, not in the counter folder, Or go back in the Redux folder and create a store.ts file here. Do remember that store is for whole application and inside the store you can define different…

Contents