October 2019
Intermediate to advanced
426 pages
11h 49m
English
We could now initialize the store in our App component, and pass it down to all of the other components. However, it is a better idea to use React Context. That way, we can access the store from anywhere in our app. MobX React offers a Provider component, which provides the store in a context.
Let's get started using the Provider component now:
import { Provider } from 'mobx-react'
import TodoStore from './store'
const store = new TodoStore()
Read now
Unlock full access