To wrap up, let's summarize the pros and cons of using MobX in a web application. First, let's start with the positives:
- It provides a simple way of dealing with state changes
- Less boilerplate code is required
- It offers flexibility in how our application code is structured
- Multiple global and local stores can be used
- It makes the App component much simpler (it offloads state management and actions to MobX)
MobX is perfect for small—and large projects—that deal with complex state changes, and state that is used across many components.
However, there are also downsides to using MobX:
- State changes could happen anywhere, not just in a single store
- Its flexibility means that it is possible to structure the project in a bad way, which could cause errors or bugs
- MobX requires a wrapper component (Provider) in order to connect the app...