diff --git a/ReactCommon/yoga/yoga/Yoga.cpp b/ReactCommon/yoga/yoga/Yoga.cpp index 3f65092b69fa2d..3c8e84a57f39ea 100644 --- a/ReactCommon/yoga/yoga/Yoga.cpp +++ b/ReactCommon/yoga/yoga/Yoga.cpp @@ -1669,6 +1669,16 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions( : YGFloatMax( 0, availableHeight - marginAxisColumn - paddingAndBorderAxisColumn); + // Measure the text under the current constraints. + const YGSize measuredSize = marker::MarkerSection::wrap( + node, + node->getMeasure(), + node, + innerWidth, + widthMeasureMode, + innerHeight, + heightMeasureMode); + if (widthMeasureMode == YGMeasureModeExactly && heightMeasureMode == YGMeasureModeExactly) { // Don't bother sizing the text if both dimensions are already defined. @@ -1689,16 +1699,6 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions( ownerWidth), YGDimensionHeight); } else { - // Measure the text under the current constraints. - const YGSize measuredSize = marker::MarkerSection::wrap( - node, - node->getMeasure(), - node, - innerWidth, - widthMeasureMode, - innerHeight, - heightMeasureMode); - node->setLayoutMeasuredDimension( YGNodeBoundAxis( node,