A JavaScript library for predictable, maintainable global state management, usable with React or any other view library.
mobxjs/mobx
Simple, scalable state management for JavaScript and TypeScript apps, with automatic dependency tracking and optimal re-rendering.
- Stars
- 28,216
- Forks
- 1,811
- Open issues
- 18
- Last commit
- 13 hours ago
What is it?
MobX is a state management library for JavaScript and TypeScript. You mark data as observable and write normal assignments to change it; MobX tracks at runtime which computations and UI components read each value, and re-runs only the ones affected by a change.
State can be modeled as plain classes or objects with makeAutoObservable, and derived values are computed automatically from observable state. Components wrapped with observer, such as React components via mobx-react-lite, re-render only when the specific fields they read are updated, so manual memoization and selectors are generally unnecessary.
Because MobX is not tied to any UI framework, state logic can live outside components and be tested on its own. The project's documentation is hosted at mobx.js.org.
Key features
- 01Automatically tracks which state each computation or component reads at runtime.
- 02Lets you update state with plain JavaScript assignments, including in async code.
- 03Derives computed values from observable state without manual wiring.
- 04Re-renders React components only when the fields they use change, via observer.
- 05Works independently of any UI framework, so state can be tested in isolation.
Use cases
- Managing shared application state in a React front end with minimal boilerplate.
- Building UI state that needs to update precisely when specific fields change.
- Keeping business logic in plain classes that are decoupled from the view layer and easy to unit test.
Quick start
- 1
Read the documentation at mobx.js.org
- 2
Install the mobx package from npm
npm install mobx
In collections
Topics
FAQ
- What is mobx?
- Simple, scalable state management for JavaScript and TypeScript apps, with automatic dependency tracking and optimal re-rendering. MobX is a state management library for JavaScript and TypeScript. You mark data as observable and write normal assignments to change it; MobX tracks at runtime which computations and UI components read each value, and re-runs only the ones affected by a change.
- Is mobx free to use? What license does it have?
- mobx is open source under the MIT license. Check the license terms before using it in commercial products.
- Is mobx still maintained?
- Actively maintained. The last commit to mobx was on Nov 7, 2026.
- What can I use mobx for?
- Managing shared application state in a React front end with minimal boilerplate. Building UI state that needs to update precisely when specific fields change. Keeping business logic in plain classes that are decoupled from the view layer and easy to unit test.
- How do I install mobx?
- Read the documentation at mobx.js.org Install the mobx package from npm: npm install mobx
- Where can I get mobx?
- The source code and installation instructions are on GitHub: https://github.com/mobxjs/mobx
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A small, hook-based state-management library for React with no providers required.
Official React bindings for Redux, connecting Redux stores to React components via hooks and a Provider.
A zero-dependency JavaScript/TypeScript library for state machines, statecharts, and actors to manage complex app and workflow logic.
A JavaScript library that lets you write immutable state updates by mutating a draft copy of the current state.
Async state management and data fetching library for web apps, with bindings for React, Vue, Svelte and Solid.