Skip to content

Commit

Permalink
Fabric: clean up oldChildShadowView when handle Insert mount (#41155)
Browse files Browse the repository at this point in the history
Summary:
We don't need to get oldChildShadowView when we handle the insert mount. So we can remove it.

## Changelog:

[IOS] [CHANGED] - Fabric: clean up oldChildShadowView when handling Insert mount

Pull Request resolved: #41155

Test Plan: None.

Reviewed By: sammy-SC

Differential Revision: D50554037

Pulled By: javache

fbshipit-source-id: 3250b6bbe119d800f05f39f790dc6949357d4f27
  • Loading branch information
zhongwuzw authored and facebook-github-bot committed Oct 25, 2023
1 parent 586de42 commit e167ac9
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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];
Expand Down

0 comments on commit e167ac9

Please sign in to comment.