Avoid modifying node.measured object, create copy instead
When working with immutable `node` data, modifying in-place `node.measured` properties is not allowed. Since we perform a shallow copy, we need to create a new `measured` object to populate `width` and `height`
This commit is contained in:
@@ -125,7 +125,7 @@ function applyChange(change: any, element: any): any {
|
|||||||
|
|
||||||
case 'dimensions': {
|
case 'dimensions': {
|
||||||
if (typeof change.dimensions !== 'undefined') {
|
if (typeof change.dimensions !== 'undefined') {
|
||||||
element.measured ??= {};
|
element.measured = {};
|
||||||
element.measured.width = change.dimensions.width;
|
element.measured.width = change.dimensions.width;
|
||||||
element.measured.height = change.dimensions.height;
|
element.measured.height = change.dimensions.height;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user