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.

Adding selectors to components

Adding selectors to components

From the course: Building Modern Projects with React

Start my 1-month free trial

Adding selectors to components

- [Instructor] Okay, so now that we've created some more advanced selectors using the re-select library, let's incorporate these selectors into our components. Now if you'll remember, what we want to do is split our to-do list into two separate lists. One that contains the completed to-dos and the other that contains the to-dos that we haven't completed yet. And as a matter of fact, now that we've created these two new selectors here, getCompletedTodos and getIncompleteTodos, this is actually quite easy. So what we're going to do is open up to-do list and the first thing we're going to go is import the two selectors we just created. So up top here we'll add getCompletedTodos and getIncompleteTodos. And once we've done that we're going to go down to our map state to props function, and instead of having a single property called todos that we pass to our component, we're going to split this into two props. One called…

Contents