diff --git a/packages/react-native/ReactCommon/yoga/yoga/style/StyleValuePool.h b/packages/react-native/ReactCommon/yoga/yoga/style/StyleValuePool.h index 597eae4c4374a9..ddb0d253630239 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/style/StyleValuePool.h +++ b/packages/react-native/ReactCommon/yoga/yoga/style/StyleValuePool.h @@ -49,9 +49,11 @@ class StyleValuePool { StyleLength getLength(StyleValueHandle handle) const { if (handle.isUndefined()) { - return StyleLength::undefined(); + static const StyleLength undefined = StyleLength::undefined(); + return undefined; } else if (handle.isAuto()) { - return StyleLength::ofAuto(); + static const StyleLength ofAuto = StyleLength::ofAuto(); + return ofAuto; } else { assert( handle.type() == StyleValueHandle::Type::Point ||