MobX πŸ‡ΊπŸ‡¦

MobX πŸ‡ΊπŸ‡¦

  • API Reference
  • δΈ­ζ–‡
  • ν•œκ΅­μ–΄
  • Sponsors
  • GitHub

β€ΊTips & Tricks

Introduction

  • About MobX
  • About this documentation
  • Installation
  • The gist of MobX

MobX core

  • Observable state
  • Actions
  • Computeds
  • Reactions {πŸš€}
  • API

MobX and React

  • React integration
  • React optimizations {πŸš€}

Tips & Tricks

  • Defining data stores
  • Understanding reactivity
  • Subclassing
  • Analyzing reactivity {πŸš€}
  • Error codes
  • Computeds with arguments {πŸš€}
  • MobX-utils {πŸš€}
  • Custom observables {πŸš€}
  • Lazy observables {πŸš€}
  • Collection utilities {πŸš€}
  • Intercept & Observe {πŸš€}

Fine-tuning

  • Configuration {πŸš€}
  • Decorators {πŸš€}
  • Migrating to MobX 7 {πŸš€}
  • Migrating from MobX 4/5 {πŸš€}
Edit

MobX error codes

In development builds, MobX throws full error messages. Production builds replace known messages with short numeric codes to keep the published bundle smaller.

CodeMessage
0Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'
1Cannot apply '{annotationType}' to '{key}': Field not found.
5'keys()' can only be used on observable objects, arrays, sets and maps
6'values()' can only be used on observable objects, arrays, sets and maps
7'entries()' can only be used on observable objects, arrays and maps
8'set()' can only be used on observable objects, arrays and maps
9'remove()' can only be used on observable objects, arrays and maps
10'has()' can only be used on observable objects, arrays and maps
11'get()' can only be used on observable objects, arrays and maps
12Invalid annotation
13Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)
14Intercept handlers should return nothing or a change object
15Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)
16Modification exception: the internal structure of an observable array was changed.
19Cannot initialize from classes that inherit from Map: {other}
20Cannot initialize map from {other}
21Cannot convert to map from '{dataStructure}'
23It is not possible to get index atoms from arrays
24Cannot obtain administration from {thing}
25the entry '{property}' does not exist in the observable map '{name}'
26please specify a property
27no observable property '{property}' found on the observable object '{name}'
28Cannot obtain atom from {thing}
29Expecting some object
30invalid action stack. did you forget to finish an action?
31missing option for computed: get
32Cycle detected in computation {name}: {derivation}
33The setter of computed value '{name}' is trying to update itself. Did you intend to update an observable value, instead of the computed property?
34[ComputedValue '{name}'] It is not possible to assign a new value to a computed value.
35There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use configure({ isolateGlobalState: true })
36isolateGlobalState should be called before MobX is running any reactions
37[mobx] observableArray.{method}() mutates the array in-place, which is not allowed inside a derivation. Use array.slice().{method}() instead
38'ownKeys()' can only be used on observable objects
39'defineProperty()' can only be used on observable objects
40Out of range: {length}
41Cannot initialize set from {other}
42Invalid index: '{key}'
43Cannot apply '{annotationType}' to '{name}' (kind: {kind}):
'{annotationType}' can only be used on properties with a function value.
44'{annotationType}' can only be used with 'makeObservable'
← Analyzing reactivity {πŸš€}Computeds with arguments {πŸš€} β†’
MobX πŸ‡ΊπŸ‡¦
Docs
About MobXThe gist of MobX
Community
GitHub discussions (NEW)Stack Overflow
More
Star