-
Notifications
You must be signed in to change notification settings - Fork 876
setDeep doesn't return a full new object #1596
Copy link
Copy link
Open
Description
Description
Right now it is a bit confusing that the docs state that setDeep returns an object with the updated value. While this is true, it will not return a fully deep-cloned object. Instead, it only returns a top-level copy, and any nested objects retain the same reference as the original. This can easily be confusing and is prone to bugs unless handled correctly.
We should either document that setDeep does not return a fully deep-cloned object of the object passed in, or support full deep cloning.
Considerations
- This is the page that documents
setDeep. - Deep cloning an object can be heavy for performance depending on when people call it. The user who reported this confusion was using it on every
resolveData, which means every keystroke or field change would trigger it.
Reactions are currently unavailable