From the course: Building Modern Projects with React

Unlock the full course today

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

Connecting components to the store

Connecting components to the store

From the course: Building Modern Projects with React

Start my 1-month free trial

Connecting components to the store

- [Instructor] So far we've defined some of the possible actions that can happen in our application and the effects that they should have on the state of our application when they're triggered. The next step is to actually give the components in our application access to the Redux store, so that they can see what the current state is, as well as trigger actions that modify the state. The way we do this is by doing what's called connecting the components to the Redux store, and to do this, let's open up one of our components, we'll start with NewTodoForm and up at the top we're going to import a function called connect from the React Redux package. Import connect from React Redux. So here's how we use this connect function. Connect is what we call a higher order function which in this case simply means that we call it with two different sets of arguments. Something like this. Don't worry too much about the details of higher…

Contents