Simple scalable state management.
MobX is a field-proven library that makes state management simple and scalable through the transparent application of functional reactive programming (TFRP).
The MobX philosophy is simple:
All changes and usage of your data are tracked at runtime, creating a dependency tree that captures all relationships between state and output. This ensures that your state-specific computations, such as React components, are only done when strictly necessary. There is no need to manually optimize components using error prone and suboptimal techniques like memoization and selectors.
MobX is obscure and allows you to manage the state of your application outside of any UI framework. This makes your code independent, portable, and above all, easily testable.
MobX 6 has released a compatible companion package
mobx-react-lite @ 3, which supports React Hooks and functional components.
We will also install the
nanoid library for creating unique
id and a library with the checkbox component
@ react-native-community / checkbox
npm install mobx mobx-react-lite nanoid @react-native-community/checkbox
yarn add mobx mobx-react-lite nanoid @react-native-community/checkbox
To use decorators, follow these steps.
Include the ExperimentalDecorators compiler option in
tsconfig.json, or pass it to the compiler as the
--experimentalDecorators flag. You must target es5 + (es5, es6, ...) using the target parameter or the --target flag.
When using c react native the following preset can be used
npm install @babel/plugin-proposal-decorators
yarn add @babel/plugin-proposal-decorators
Thanks goes to these wonderful people (emoji key):