Breaking changes in Mobx 6
See original GitHub issueUnfortunately there has been a breaking change with mobx 6 - makeObservable(this)
will have to be added to the constructor of any classes that are using the @observable
, @action
or @computed
decorators.
More information and example here: https://mobx.js.org/enabling-decorators.html
Alternatively the decorators can be removed entirely and makeObservable
can be used with a second parameter, which is described in the upgrade guide:
https://mobx.js.org/migrating-from-4-or-5.html#upgrading-classes-to-use-makeobservable
I’m not sure which method you would prefer?
Cheers, Felix
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:13 (13 by maintainers)
Top Results From Across the Web
Migrating from MobX 4/5
This pages covers a migration guide from MobX 4 and 5 to 6, and an extensive list of all the changes. For a...
Read more >Announcing MobX 6
MobX 4 and 5 are both superseded by version 6 and will no longer be actively maintained. Further breaking changes are discussed in...
Read more >Developers - Breaking changes in Mobx 6 -
Unfortunately there has been a breaking change with mobx 6 - makeObservable(this) will have to be added to the constructor of any classes...
Read more >Mobx Reactive State Management Library Released ...
MobX 6 removes support for the current implementation of decorators and supports instead the new JavaScript decorators proposal. The new ...
Read more >Howto migrate from MobX 5 to MobX 6 with React + ...
Well, it seems like you have tried first of three ways to migrate and did not liked it. But this way is only...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@foxhound87 @ajorkowski What do you think about upgrading Babel to 7, MobX to 6 and releasing a new major version of mobx-react-form without support for older versions of MobX? I did it in my fork and I can create the PRs (all tests are green except the performance test).
The mobx6 support has been released in version 3