Introduction
mobx-store-provider is a library that provides React Hooks to setup and access mobx-state-tree models from within React Function Components.
Its goal is to provide a straight-forward, minimalist, and terse API that allows you to easily incorporate mobx-state-tree into functional React components.
Install it with NPM or Yarn:
npm i mobx-store-provider
yarn add mobx-store-provider
- Basic example
- API details and examples
- useProvider - Provide your components with a store
- useCreateStore - Create a new store inside a component
- useStore - Use a store in a component
- getStore - Use a store outside a component
- Multiple stores
- Local state
- Typescript
- Testing
- Motivation
- Upgrading 1.x -> 2.x