-
-
Notifications
You must be signed in to change notification settings - Fork 849
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
deep freeze of object property in immerable class #604
Comments
The handling of getters / setters will change in Immer 7, please revisit after Immer 7 has been released. |
Would you mind checking again against immer 7? It handles getters and setters differently, which might be used in your project. If Immer 7 doesn't help, an actual reproduction is needed. |
Yep, with v7 it works fine. Still not sure what exactly caused the issue – my case didn't look like #438, I have only primitive props everywhere. But using Thanks for new cool major version! |
I have to reopen this issue. There is still smth wrong, even on version Current sandbox behavior is:
In my project, in pretty same situation I have |
I'm not sure what 'useReducer(produce)' is supposed to do. Can you simplify
the example a bit and leave React out of it?
…On Wed, 24 Jun 2020, 15:42 Jeron Diovis, ***@***.***> wrote:
Reopened #604 <#604>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#604 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBDSVG7VE77DLZRPTNLRYIGGNANCNFSM4NJBDKLQ>
.
|
Now it throws just like it does in my app. |
Thanks for the update! |
Thanks for the detailed reproduction. Will publish a fix soon! |
🎉 This issue has been resolved in version 7.0.7 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🙋♂ Question
I'm trying to do smth like this:
Here is my sandbox: https://codesandbox.io/s/immerable-83jiv. It does work without any problems.
In console there you can see, that property
_data
is marked as non-writable and non-configurable, but_data.x
is writable and configurable:So, it looks like
thing
is not deeply frozen – despite ofsetAutoFreeze(true)
.At the same time, in my real project, with exactly same setup I get this:
(it's a redux app with curried producers, as described in docs)
And in console I see that
_state.selected
is non-configurable and non-writable.I really can't understand why I can't reproduce the same in sandbox, and which of two cases is actually a correct behavior.
If it's possible, can you give any clue about this situation? Like, it has to be smth very basic about immer which I'm missing.
Environment
The text was updated successfully, but these errors were encountered: