Open-source project
mobxjs/mobx avatar
mobxjs/mobx

MobX: signal-based state management for JavaScript and TypeScript

Simple, scalable state management.

28,211 stars1,811 forksTypeScriptMIT

At a glance

What is it?
MobX tracks state reads and writes at runtime and derives everything it can from them. Here is what the mechanism actually does, how to install it, and where it stops being the right tool.
Who is it for?
Adopt MobX when your state is a mutable object graph that many components read from and few places write to, and when you want updates to follow plain JavaScript assignment rather than dispatched actions. Do not adopt it if you need a serializable, replayable event log of every state change, or if your team cannot absorb a reactivity model that only shows itself at runtime.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 2 days ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • mobxjs/mobx28,211 ★ · -4
Star history
Repository2026-09-282026-11-15
mobxjs/mobx28.2k28.2k

-4 Stars in the last 48 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

What MobX solves, and who it is written for

The README states the philosophy in one line: "Anything that can be derived from the application state, should be. Automatically." That is the whole pitch. MobX is for applications where the same piece of data is read in several places and written in one, and where the author does not want to hand-wire the propagation between them. A record field changes; every computation that read that field runs again.

The intended audience is JavaScript and TypeScript front-end teams, most often React teams, since the repository ships mobx-react-lite and mobx-react as sibling packages in the same workspace. The library itself is framework-agnostic; the React bindings are separate packages that depend on it. If you have a plain TypeScript application with derived values and no UI framework at all, MobX still applies, but you will be wiring the observation boundary yourself.

MobX is not a store container. It does not give you a reducer, a dispatch function, or a single root object with a schema. It gives you observable values, computed derivations and reactions, and leaves the shape of your state to you.

How the reactivity mechanism works

MobX describes itself as signal based and says it applies functional reactive programming transparently. The README gives the mechanism plainly: "All changes to and uses of your data are tracked at runtime, building a dependency tree that captures all relations between state and output."

So the graph is not declared. It is discovered. When a computation runs, the observable values it reads are recorded as its dependencies. When one of those values is written, MobX walks the recorded edges and marks the dependent computations for re-execution. The README's example of the write side is a normal JavaScript assignment: "Simply use a normal JavaScript assignment, the reactivity system will detect all your changes and propagate them out to where they are being used."

The consequence worth understanding is that there is no diffing step and no subscription list you maintain by hand. The cost is that the dependency graph exists only at runtime. Nothing in the type system tells you which observables a given computed value reads, and a computed value that reads nothing observable will simply never invalidate. That is the trade: less boilerplate, less static visibility.

The README also notes that no special tools are required when updating data in an asynchronous process.

Installing MobX and writing a first observable

The README itself does not carry install instructions; it points at the documentation site at mobx.js.org. The npm package name is mobx, matching the workspace entry packages/mobx in the root package.json, and the latest release is [email protected].

The root package.json defines a workspace-scoped script named mobx that forwards to the mobx package, and a build script that runs build across the workspaces. For a consuming project, the package is installed from npm under the name mobx.

For a React application, the repository also contains mobx-react-lite, listed in the workspaces array alongside mobx-react, eslint-plugin-mobx and mobx-undecorate.

What the README does document is the shape of the code: state is written with a normal JavaScript assignment, and all changes to and uses of the data are tracked at runtime. The README's benefits section states that computations depending on your state, such as React components, run when the state they read changes, and that no special tools are required when updating data in an asynchronous process.

The README also includes a quick example that models state with makeAutoObservable from mobx and wraps a React component in observer from mobx-react-lite, which re-renders the component when the timer.secondsPassed field it reads is updated. For the full API surface, the README directs readers to mobx.js.org, and the repository keeps its own docs in the docs/ and website/ directories.

Where MobX is the wrong choice

The dependency graph is discovered at runtime, and that is also the main failure mode. A computation that reads a non-observable value looks correct, type-checks, and never re-runs. There is no compiler error for this. The README's framing of the library as boilerplate-free is accurate, but the boilerplate it removes is the boilerplate that would have made the missing edge visible.

Second, MobX is not an audit log. If your requirement is that every state transition is a named, serializable event you can replay, ship to a server, or step through in a devtools timeline, MobX's model of direct mutation is working against you. The README's own selling point, that you update data with a normal assignment, is exactly what makes transitions anonymous.

Third, scale of team matters more than scale of state. The README calls the library scalable, and for data volume that is plausible. For a large team where many engineers touch the same store, the absence of a declared schema means the contract between modules lives in convention. Nothing in the repository enforces it.

Finally, if your application state is genuinely small, a handful of values read by one component each, the reactivity graph is machinery you will pay for and not use.

MobX compared with Redux

The comparison people search for is MobX against Redux, and the difference is architectural rather than stylistic. Redux keeps one store, and the only way to change it is to dispatch an action that a reducer handles. State transitions are therefore explicit, named and serializable by construction. MobX keeps whatever objects you like, and any code holding a reference can write to them.

That inverts the debugging story. With Redux you get a log of actions. With MobX you get a dependency tree, which the README describes as capturing all relations between state and output. The tree tells you what will re-run; the action log tells you what happened. Neither replaces the other.

The performance argument also inverts. Redux re-runs reducers and relies on selector memoization and reference equality to avoid re-rendering. MobX tracks reads directly, so a component that reads one field is not invalidated by a write to a different field. The README claims "effortless optimal rendering" on this basis. That claim is about the mechanism, not a measured result, and it holds only as long as everything read is observable.

A middle path exists in practice: teams use MobX for local, high-frequency state and keep Redux for anything that needs a durable transition log.

Maintenance, releases and the MIT licence

The repository is not archived, and the last push was on 2026-11-01, so the project is being worked on. Releases move through changesets: the root package.json defines a release script that runs prepublishOnly across the workspaces and then changeset publish, and the repository has a .changeset directory for the pending entries. The latest release is [email protected] from 2026-11-01, preceded by [email protected] on 2026-10-27.

Upgrade cost is concentrated in major versions. The workspace contains a package called mobx-undecorate, which is a codemod tool, and its presence in the repository is the clearest signal that migrating older codebases has historically required mechanical source changes.

The licence is MIT. That is permissive: it allows use, modification and redistribution, including in closed-source products, provided the copyright notice and licence text are retained. It is not a legal opinion, and if your organisation has a policy about bundled third-party notices, check how your build tooling emits them.

Editorial conclusion

Adopt MobX when your state is a mutable object graph that many components read from and few places write to, and when you want updates to follow plain JavaScript assignment rather than dispatched actions. Do not adopt it if you need a serializable, replayable event log of every state change, or if your team cannot absorb a reactivity model that only shows itself at runtime. Before committing, work through the README's quick example against the current release ([email protected]), and use mobx.js.org to choose between the mobx-react-lite and mobx-react bindings.

Frequently asked questions

What is MobX used for?

MobX manages application state by tracking which values a computation reads and re-running it when those values change. The README describes it as a signal-based library that applies functional reactive programming, and the repository ships React bindings alongside the core package.

Which is better, MobX or Redux?

They differ in how state changes are expressed. Redux requires dispatching actions that reducers handle, so transitions are named and serializable, while MobX lets you write to observable values with a plain JavaScript assignment and rebuilds a runtime dependency tree instead. Neither is better in the abstract; the choice depends on whether you need a transition log or automatic propagation.

How do I install MobX in a React project?

The package is published on npm under the name mobx, matching the workspace entry packages/mobx in the repository. The README points to mobx.js.org for documentation rather than carrying install steps itself.

What is mobx-react-lite and do I need mobx-react too?

They are separate packages in the same repository workspace, listed together in the workspaces array of the root package.json. The README's quick example imports observer from mobx-react-lite; check the documentation site before adding both.

Why does my MobX computed value never update?

The dependency tree is built at runtime from the observable values a computation reads. If a computation reads a value that is not observable, no edge is recorded and the computation will not re-run.

Official sources

  1. License: MIT
  2. mobxjs/mobx on GitHub
  3. Project website
  4. README
  5. Releases
Community

Where developers are discussing it

Posts on Hacker News, dev.to and Lobsters that link to this repository, found by our scan of those communities. 0 in the last 30 days; newest first.

Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/mobxjs-mobx.svg)](https://hysenlabs.com/projects/mobxjs-mobx)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/mobxjs-mobx.svg)](https://hysenlabs.com/projects/mobxjs-mobx)

Was this useful?