-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
computed with ifavailable cause Error #2619
Comments
Minimal repro: const o = observable({});
autorun(() => {
JSON.stringify(o);
}) Possible solutions: |
Btw |
This behavior is correct, as JSON.stringify would behave differently indeed a non proxy environment, and this error is an early warning for it. |
But same code work fine with mobx@5 |
Mobx5 required proxy support - it would not work at all in env without proxies, you had to use Mobx4 instead. |
Yes, Mobx4 and Mobx5 is fine with JSON.stringify , but Mobx6 with |
It's breaking because it would break if you would run this code on Internet Explorer, just as this would break on Internet Explorer if you were running this very same code with MobX5 on Internet Explorer. Please read the conversation again, it errors because you configured it to error as an early warning this will not run on older browsers. If you want the MobX 4 behavior, put it on |
@doxiaodong In Mobx4 |
Thanks,I use |
Intended outcome:
cause by Reflect.ownKeys
it is seem broken with JSON.stringify
Actual outcome:
How to reproduce the issue:
https://codesandbox.io/s/multi-selection-forked-vdjqn?file=/src/index.tsx
Versions
mobx@6.0.4
useProxies: 'ifavailable'
The text was updated successfully, but these errors were encountered: