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

Compatibility with MobX 6 useProxies: "ifavailable" option #1702

Closed
3 tasks done
BATCOH opened this issue Apr 23, 2021 · 1 comment · Fixed by #1703
Closed
3 tasks done

Compatibility with MobX 6 useProxies: "ifavailable" option #1702

BATCOH opened this issue Apr 23, 2021 · 1 comment · Fixed by #1703

Comments

@BATCOH
Copy link
Contributor

BATCOH commented Apr 23, 2021

Bug report

  • I've checked documentation and searched for existing issues
  • I've made sure my project is based on the latest MST version
  • Fork this code sandbox or another minimal reproduction.

Sandbox link or minimal reproduction code
https://codesandbox.io/s/mobx-state-tree-todolist-ifavailable-t9w2z?file=/index.js

Describe the expected behavior
MST should work with useProxies: "ifavailable" option from mobx.

Describe the observed behavior
MST uses Object.defineProperty internally in addHiddenFinalProp/addHiddenWritableProp utils that lead to crash in ifavailable mode.
See also #2876@mobx
Since mobx@6.3.0 released with a convenient defineProperty from object-api, it seems to be a good idea to use it in MST.

I'm actually working on PR right now and will add it as soon as I can.

@BATCOH BATCOH changed the title Compatibility with MobX 6 useProxies: "ifavailable" option. Compatibility with MobX 6 useProxies: "ifavailable" option Apr 23, 2021
@jamonholmgren
Copy link
Collaborator

5.0.2 is released: https://github.com/mobxjs/mobx-state-tree/releases/tag/v5.0.2

Please test it on your project and report issues.

Thanks again @BATCOH !

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

Successfully merging a pull request may close this issue.

2 participants