Skip to content

Commit 0569221

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
Set contentView's frame in setter
Summary: In D20836890 we no longer set `_contentView.frame` inside `layoutSubviews`. This doesn't work well with component views that set their `contentView` after `updateLayoutMetrics` is called. For Example legacy interop which sets its contentView in the `finalizeUpdates` method. Other component views that set their contentView during initialisation are fine. Changelog: [Internal] Reviewed By: shergin Differential Revision: D21302108 fbshipit-source-id: 5adcf489e4e650ac04b84c836a8f8d6f55a77267
1 parent 673cbb3 commit 0569221

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ - (void)setContentView:(UIView *)contentView
4848

4949
if (_contentView) {
5050
[self addSubview:_contentView];
51+
_contentView.frame = RCTCGRectFromRect(_layoutMetrics.getContentFrame());
5152
}
5253
}
5354

0 commit comments

Comments
 (0)