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

cloneDeep not cloning nested Map #5817

Open
amdeenmsft opened this issue Feb 12, 2024 · 0 comments
Open

cloneDeep not cloning nested Map #5817

amdeenmsft opened this issue Feb 12, 2024 · 0 comments

Comments

@amdeenmsft
Copy link

amdeenmsft commented Feb 12, 2024

I have this object
{ contentMap: Map<string, string>} .

I use cloneDeep to clone the object, then try to update the contentMap.
I get this Immer exception: Error: [Immer] This object has been frozen and should not be mutated when doing:

clonedComponent.contentMap.set({...})

I have determined that the cloned object's contentMap is still referencing the original, and I have to declare a new content map and manually set it on the cloned object. The docs suggest this should be supported behavior, so there seems to be a bug

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

No branches or pull requests

1 participant