diff --git a/React/Base/RCTRootView.m b/React/Base/RCTRootView.m index d8d0f90f2..3e052e215 100644 --- a/React/Base/RCTRootView.m +++ b/React/Base/RCTRootView.m @@ -217,11 +217,15 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder) _contentView = [[RCTRootContentView alloc] initWithFrame:self.bounds bridge:bridge reactTag:self.reactTag - sizeFlexiblity:self.sizeFlexibility]; + sizeFlexiblity:_sizeFlexibility]; [self runApplication:bridge]; _contentView.backgroundColor = self.backgroundColor; [self insertSubview:_contentView atIndex:0]; + + if (_sizeFlexibility == RCTRootViewSizeFlexibilityNone) { + self.intrinsicSize = self.bounds.size; + } } - (void)runApplication:(RCTBridge *)bridge diff --git a/React/Views/RCTShadowView.m b/React/Views/RCTShadowView.m index b3e51ad0b..3bbd045ea 100644 --- a/React/Views/RCTShadowView.m +++ b/React/Views/RCTShadowView.m @@ -555,10 +555,13 @@ RCT_DIMENSION_PROPERTY(Left, left, PositionStart) - (void)setFrame:(CGRect)frame { - CSSNodeStyleSetPositionLeft(_cssNode, CGRectGetMinX(frame)); - CSSNodeStyleSetPositionTop(_cssNode, CGRectGetMinY(frame)); - CSSNodeStyleSetWidth(_cssNode, CGRectGetWidth(frame)); - CSSNodeStyleSetHeight(_cssNode, CGRectGetHeight(frame)); + if (!CGRectEqualToRect(frame, _frame)) { + _frame = frame; + CSSNodeStyleSetPositionLeft(_cssNode, CGRectGetMinX(frame)); + CSSNodeStyleSetPositionTop(_cssNode, CGRectGetMinY(frame)); + CSSNodeStyleSetWidth(_cssNode, CGRectGetWidth(frame)); + CSSNodeStyleSetHeight(_cssNode, CGRectGetHeight(frame)); + } } static inline void RCTAssignSuggestedDimension(CSSNodeRef cssNode, CSSDimension dimension, CGFloat amount)