From the course: Building Modern Projects with React

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Creating Redux actions

Creating Redux actions

From the course: Building Modern Projects with React

Start my 1-month free trial

Creating Redux actions

- Now that we've performed the basic set-up to add Redux to our React app, we're going to actually create some actions and reducers that our application can use to help keep track of its state. In this video, we're going to start off by defining some Redux actions. So the first thing we're going to do is create a new file inside of our source slash to do directory, and we'll call it actions dot js. And then, inside this file, we're going to define a create to do action that our app will fire whenever the user types something in the new to do form component that we created and presses the create to do button. We'll see how this all fits together later. So we saw in a previous video that every action is essentially just a JSON object with a type property and possibly a payload. And because of this, we're going to start off by creating a constant for the actions type. We're going to say export const create to do, all…

Contents