foxhound87 / mobx-react-form

Reactive MobX Form State Management
https://foxhound87.github.io/mobx-react-form
MIT License
1.1k stars 129 forks source link

Make mobx-react-form compatible with MobX 6.1 #566

Closed vkrol closed 3 years ago

vkrol commented 3 years ago

In MobX 6.1 Attempt to re-annotate property always throws. Previously mostly undefined outcome. https://github.com/mobxjs/mobx/releases#:~:text=Attempt%20to%20re-annotate%20property%20always%20throws.%20Previously%20mostly%20undefined%20outcome.

The $submitting and $validating properties are defined in Base (https://github.com/foxhound87/mobx-react-form/blob/master/src/Base.js#L13 + https://github.com/foxhound87/mobx-react-form/blob/master/src/Base.js#L16), so we have to remove this properties from Form, because of the error:

Error: [MobX] Cannot apply '@observable' to 'Form.prototype.$submitting':
The field is already decorated with '@observable'.
Re-decorating fields is not allowed.
Use '@override' decorator for methods overriden by subclass.

Fixes #569.

zcaceres commented 3 years ago

+1 need a fix like this to upgrade to MobX 6

zcaceres commented 3 years ago

@foxhound87 Desperate for this to be merged in so that we can upgrade to MobX6.1. Anything we can do to help?

foxhound87 commented 3 years ago

:tada: This PR is included in version 3.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: