Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work in strict mode #1

Open
all-iver opened this issue Nov 15, 2017 · 1 comment
Open

Does not work in strict mode #1

all-iver opened this issue Nov 15, 2017 · 1 comment

Comments

@all-iver
Copy link

It looks like mobx-form-store is making changes to observables outside of actions. If this is not an easy fix, perhaps there should be a note in the docs that strict mode is not supported? Here's what I'm seeing:

[mobx] Invariant failed: Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: FormStore@2402.isSaving
    at invariant (mobx.module.js:2327)
    at fail (mobx.module.js:2322)
    at checkIfStateModificationsAreAllowed (mobx.module.js:2891)
    at ObservableValue../node_modules/mobx/lib/mobx.module.js.ObservableValue.prepareNewValue (mobx.module.js:796)
    at setPropertyValue (mobx.module.js:1673)
    at FormStore.set [as isSaving] (mobx.module.js:1641)
    at FormStore.$IfStatement_7 (FormStore.js:783)
    at FormStore.<anonymous> (FormStore.js:837)
    at boundThen (asSchemaField.js:162)
    at new Promise (<anonymous>)
    at FormStore.js:735
    at <anonymous>
@alexhisen
Copy link
Owner

Yeah, that's true. It only wraps multiple changes in action to keep them atomic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants