3535
3636static void applyProps (RCTViewComponentView *view, const Props::Shared &props)
3737{
38- [view updateProps: props oldProps: view.props];
38+ // Like the mounting layer does for an Insert, pass no old props: the view
39+ // diffs against its own.
40+ [view updateProps: props oldProps: nullptr ];
3941 LayoutMetrics layoutMetrics;
4042 layoutMetrics.frame .size = {100 , 40 };
4143 [view updateLayoutMetrics: layoutMetrics oldLayoutMetrics: EmptyLayoutMetrics];
@@ -73,15 +75,15 @@ @implementation RCTViewComponentViewContainerTests
7375- (void )testChildrenMovedOutOfContainerStayBelowSelfDrawnLayers
7476{
7577 RCTViewComponentView *parent = [RCTViewComponentView new ];
76- applyProps (parent, makeProps (/* clips */ true , /* hasBoxShadow */ true ));
78+ applyProps (parent, makeProps (/* clips= */ true , /* hasBoxShadow= */ true ));
7779
7880 RCTViewComponentView *first = [RCTViewComponentView new ];
7981 RCTViewComponentView *second = [RCTViewComponentView new ];
8082 [parent mountChildComponentView: first index: 0 ];
8183 [parent mountChildComponentView: second index: 1 ];
8284 XCTAssertNotEqual (first.superview , parent, @" children of a clipping view with a box shadow go into a container" );
8385
84- applyProps (parent, makeProps (/* clips */ false , /* hasBoxShadow */ true ));
86+ applyProps (parent, makeProps (/* clips= */ false , /* hasBoxShadow= */ true ));
8587 XCTAssertEqual (first.superview , parent);
8688 XCTAssertEqual (parent.layer .sublayers .firstObject , first.layer , @" children must precede the box shadow layer" );
8789
@@ -100,7 +102,7 @@ - (void)testChildrenMovedOutOfContainerStayBelowSelfDrawnLayers
100102- (void )testRecycledViewDropsContainerBeforeNextOwnerMountsChildren
101103{
102104 RCTViewComponentView *view = [RCTViewComponentView new ];
103- applyProps (view, makeProps (/* clips */ true , /* hasBoxShadow */ true ));
105+ applyProps (view, makeProps (/* clips= */ true , /* hasBoxShadow= */ true ));
104106 RCTViewComponentView *previousChild = [RCTViewComponentView new ];
105107 [view mountChildComponentView: previousChild index: 0 ];
106108 UIView *previousContainer = previousChild.superview ;
@@ -115,7 +117,7 @@ - (void)testRecycledViewDropsContainerBeforeNextOwnerMountsChildren
115117 RCTViewComponentView *first = [RCTViewComponentView new ];
116118 [view mountChildComponentView: first index: 0 ];
117119 XCTAssertEqual (first.superview , view);
118- applyProps (view, makeProps (/* clips */ false , /* hasBoxShadow */ true ));
120+ applyProps (view, makeProps (/* clips= */ false , /* hasBoxShadow= */ true ));
119121 XCTAssertFalse (view.clipsToBounds );
120122
121123 RCTViewComponentView *second = [RCTViewComponentView new ];
@@ -132,12 +134,12 @@ - (void)testRecycledViewDropsContainerBeforeNextOwnerMountsChildren
132134- (void )testRecycledViewKeepsClippingForNextOwnerThatClips
133135{
134136 RCTViewComponentView *view = [RCTViewComponentView new ];
135- applyProps (view, makeProps (/* clips */ true , /* hasBoxShadow */ true ));
137+ applyProps (view, makeProps (/* clips= */ true , /* hasBoxShadow= */ true ));
136138 [view prepareForRecycle ];
137139
138140 RCTViewComponentView *child = [RCTViewComponentView new ];
139141 [view mountChildComponentView: child index: 0 ];
140- applyProps (view, makeProps (/* clips */ true , /* hasBoxShadow */ false ));
142+ applyProps (view, makeProps (/* clips= */ true , /* hasBoxShadow= */ false ));
141143
142144 XCTAssertEqual (child.superview , view);
143145 XCTAssertTrue (view.clipsToBounds );
@@ -148,7 +150,7 @@ - (void)testRecycledViewKeepsClippingForNextOwnerThatClips
148150- (void )testRecycledViewMovesContentViewOutOfContainer
149151{
150152 RCTViewComponentView *view = [RCTViewComponentView new ];
151- applyProps (view, makeProps (/* clips */ true , /* hasBoxShadow */ true ));
153+ applyProps (view, makeProps (/* clips= */ true , /* hasBoxShadow= */ true ));
152154 UIView *contentView = [UIView new ];
153155 view.contentView = contentView;
154156 XCTAssertNotEqual (contentView.superview , view);
0 commit comments