No force layout of superview and contentSize recalculation if intrinsicContentSize not changed

Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/20664

Differential Revision: D14103326

Pulled By: cpojer

fbshipit-source-id: 9346f12827843960178fbeef646bdb4c2cbd71ce
This commit is contained in:
zhongwuzw
2019-02-15 08:26:50 -08:00
committed by Facebook Github Bot
parent c9ee902485
commit da023c5873

View File

@@ -343,13 +343,13 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)
_intrinsicContentSize = intrinsicContentSize;
[self invalidateIntrinsicContentSize];
[self.superview setNeedsLayout];
// Don't notify the delegate if the content remains invisible or its size has not changed
if (bothSizesHaveAZeroDimension || sizesAreEqual) {
return;
}
[self invalidateIntrinsicContentSize];
[self.superview setNeedsLayout];
[_delegate rootViewDidChangeIntrinsicSize:self];
}