@@ -215,9 +215,32 @@ - (void)collectUpdatedProperties:(NSMutableSet *)applierBlocks
215215 }
216216}
217217
218+
219+ - (void )applySizeConstraints
220+ {
221+ switch (_sizeFlexibility) {
222+ case RCTRootViewSizeFlexibilityNone:
223+ break ;
224+ case RCTRootViewSizeFlexibilityWidth:
225+ _cssNode->style .dimensions [CSS_WIDTH] = CSS_UNDEFINED;
226+ break ;
227+ case RCTRootViewSizeFlexibilityHeight:
228+ _cssNode->style .dimensions [CSS_HEIGHT] = CSS_UNDEFINED;
229+ break ;
230+ case RCTRootViewSizeFlexibilityWidthAndHeight:
231+ _cssNode->style .dimensions [CSS_WIDTH] = CSS_UNDEFINED;
232+ _cssNode->style .dimensions [CSS_HEIGHT] = CSS_UNDEFINED;
233+ break ;
234+ }
235+ }
236+
218237- (void )collectRootUpdatedFrames : (NSMutableSet *)viewsWithNewFrame
219- parentConstraint : (__unused CGSize)parentConstraint
220238{
239+ RCTAssert (RCTIsReactRootView (self.reactTag ),
240+ @" The method has been called on a view with react tag %@ , which is not a root view" , self.reactTag );
241+
242+ [self applySizeConstraints ];
243+
221244 [self fillCSSNode: _cssNode];
222245 layoutNode (_cssNode, CSS_UNDEFINED, CSS_DIRECTION_INHERIT);
223246 [self applyLayoutNode: _cssNode viewsWithNewFrame: viewsWithNewFrame absolutePosition: CGPointZero];
@@ -245,6 +268,7 @@ - (instancetype)init
245268 if ((self = [super init ])) {
246269
247270 _frame = CGRectMake (0 , 0 , CSS_UNDEFINED, CSS_UNDEFINED);
271+ _sizeFlexibility = RCTRootViewSizeFlexibilityNone;
248272
249273 for (unsigned int ii = 0 ; ii < META_PROP_COUNT; ii++) {
250274 _paddingMetaProps[ii] = CSS_UNDEFINED;
0 commit comments