question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Breaking changes in Mobx 6

See original GitHub issue

Unfortunately 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

3reactions
vkrolcommented, Nov 12, 2020

@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).

  1. Upgrade Babel to 7: https://github.com/foxhound87/mobx-react-form/compare/master...vkrol:upgrade-babel-to-7
  2. Upgrade MobX to 6: https://github.com/vkrol/mobx-react-form/compare/upgrade-babel-to-7...vkrol:upgrade-mobx-to-6
2reactions
foxhound87commented, Jan 4, 2021

The mobx6 support has been released in version 3

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found