October 2019
Intermediate to advanced
426 pages
11h 49m
English
Lastly, we have to connect the TodoFilter component in order to be able to select different filters. We also want to show the currently selected filter, so this component needs to be an observer.
Let's connect the TodoFilter component now:
import { inject, observer } from 'mobx-react'
const TodoFilterItem = inject('todoStore')(observer(function TodoFilterItemWrapped ({ name, todoStore }) {
function handleFilter () { todoStore.filterTodos(name) }
Read now
Unlock full access