Skip to content

Commit

Permalink
Set contentView's frame in setter
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sammy-SC authored and facebook-github-bot committed Apr 30, 2020
1 parent 673cbb3 commit 0569221
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ - (void)setContentView:(UIView *)contentView

if (_contentView) {
[self addSubview:_contentView];
_contentView.frame = RCTCGRectFromRect(_layoutMetrics.getContentFrame());
}
}

Expand Down

0 comments on commit 0569221

Please sign in to comment.