From 98fd7da9d2de3c27bb8248ed5f97b7e57dcdb8a9 Mon Sep 17 00:00:00 2001 From: zhongwuzw Date: Mon, 23 Oct 2023 19:10:56 +0800 Subject: [PATCH] [iOS] Fabric: clean up oldChildShadowView when handle Insert mount --- .../React/Fabric/Mounting/RCTMountingManager.mm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/react-native/React/Fabric/Mounting/RCTMountingManager.mm b/packages/react-native/React/Fabric/Mounting/RCTMountingManager.mm index b4cfb3d0ede108..0e2323f88a5a42 100644 --- a/packages/react-native/React/Fabric/Mounting/RCTMountingManager.mm +++ b/packages/react-native/React/Fabric/Mounting/RCTMountingManager.mm @@ -73,7 +73,6 @@ static void RCTPerformMountInstructions( } case ShadowViewMutation::Insert: { - auto &oldChildShadowView = mutation.oldChildShadowView; auto &newChildShadowView = mutation.newChildShadowView; auto &parentShadowView = mutation.parentShadowView; auto &newChildViewDescriptor = [registry componentViewDescriptorWithTag:newChildShadowView.tag]; @@ -83,11 +82,11 @@ static void RCTPerformMountInstructions( RCTAssert(newChildShadowView.props, @"`newChildShadowView.props` must not be null."); - [newChildComponentView updateProps:newChildShadowView.props oldProps:oldChildShadowView.props]; + [newChildComponentView updateProps:newChildShadowView.props oldProps:nullptr]; [newChildComponentView updateEventEmitter:newChildShadowView.eventEmitter]; - [newChildComponentView updateState:newChildShadowView.state oldState:oldChildShadowView.state]; + [newChildComponentView updateState:newChildShadowView.state oldState:nullptr]; [newChildComponentView updateLayoutMetrics:newChildShadowView.layoutMetrics - oldLayoutMetrics:oldChildShadowView.layoutMetrics]; + oldLayoutMetrics:EmptyLayoutMetrics]; [newChildComponentView finalizeUpdates:RNComponentViewUpdateMaskAll]; [parentViewDescriptor.view mountChildComponentView:newChildComponentView index:mutation.index];