talira

Simple, scalable state management

open sourceMITfree

MobX is a signal-based state management library for JavaScript and TypeScript that applies functional reactive programming behind the scenes. You change state with ordinary assignments, and MobX tracks at runtime which computations and components depend on it, so only those re-run, with no manual memoization or selectors. It works outside any UI framework and pairs with React through mobx-react-lite and mobx-react. It is MIT licensed and funded by sponsors.

Problems it solves

  • manage shared state in my React app without writing reducers and boilerplate
  • stop React components re-rendering when unrelated state changes
  • keep app state in plain JavaScript objects that update the UI automatically

Features

  • observable state updated with plain assignments
  • computed values and reactions
  • re-renders only the components that use changed state
  • works outside any UI framework
  • React bindings (mobx-react-lite)

Alternatives

The same job

These do what MobX does.

  1. Redux A JS library for predictable global state management
  2. Zustand Bear necessities for React state
  3. Jotai Atomic state management for React
  4. Valtio Proxy-based state for React and vanilla JavaScript
  5. Immer Work with immutable state by writing ordinary mutating code

Compare MobX with the top 3