October 2019
Intermediate to advanced
426 pages
11h 49m
English
To be able to toggle or remove todo items, we have to connect the TodoItem component. We also define the TodoItem component as an observer, so that MobX knows it will have to re-render the component when the item object changes.
Let's connect the TodoItem component now:
import { inject, observer } from 'mobx-react'
export default inject('todoStore')(observer(function TodoItem ({ item, todoStore }) {
Read now
Unlock full access