Skip to content
New issue

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

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

Already on GitHub? # to your account

Different behavior with nested drafts depending on setUseProxies #588

Closed
1 of 2 tasks
bug-brain opened this issue Apr 27, 2020 · 1 comment
Closed
1 of 2 tasks

Different behavior with nested drafts depending on setUseProxies #588

bug-brain opened this issue Apr 27, 2020 · 1 comment

Comments

@bug-brain
Copy link

🐛 Bug Report

Changes to a draft that is a child of another draft will not be recorded if proxies are used.

Link to repro

https://codesandbox.io/s/immer-sandbox-cge23

To Reproduce

Run the sandbox or put a draft into an object that is to be drafted with.

Observed behavior

Changes are only recorded with setUseProxies(false). It seems that otherwise a proxy is created for the draft so that no mutating operations get through to it.

Expected behavior

The behavior of setUseProxies(true) should changed.

Environment

  • Immer version: 6.0.3
  • Occurs with setUseProxies(true)
  • Occurs with setUseProxies(false) (ES5 only)
@aleclarson
Copy link
Member

🎉 This issue has been resolved in version 7.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants