3

As stated in MobX FAQ,

Is React Native supported?

Yes, mobx and mobx-react will work on React Native. The latter through importing "mobx-react/native". The devtools don't support React Native. Note that if you indend to use your observer components with hot reloading, decorators in the components may not always work. If that is the case, use the functions instead (eg. action(fn) instead of @action or observer(component) instead of @observer).

I have doubts because FAQ also mentions that MobX runs on any ES5 environment, while this is applicable to MobX 4 and lower.

  • What is the problem with hot reloading and decorators?

  • Is the problem still relevant?

  • Is it specific to React and MobX combination?

  • Is it applicable to React Native only, and why?

  • Does a workaround suggest this.method = action(fn), or ComponentClass.prototype.method = action(fn)?

  • Can it be worked around with MobX decorate?

Estus Flask
  • 206,104
  • 70
  • 425
  • 565

0 Answers0