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
From the course: Building Modern Projects with React
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…
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
-
-
-
-
-
Why do you need Redux?4m 11s
-
(Locked)
How does Redux work?4m 35s
-
(Locked)
Adding Redux to a React app3m 24s
-
(Locked)
Creating Redux actions4m 16s
-
(Locked)
Creating reducers6m 23s
-
(Locked)
Connecting components to the store7m 1s
-
(Locked)
Running a React-Redux application4m 32s
-
(Locked)
Persisting the Redux store6m 43s
-
(Locked)
Redux DevTools3m 34s
-
(Locked)
Redux best practices3m 53s
-
(Locked)
Challenge: Adding a Redux flow1m 56s
-
(Locked)
Solution: Adding a Redux flow4m 14s
-
-
-
-
-
-