diff --git a/ReactCommon/yoga/yoga/CompactValue.h b/ReactCommon/yoga/yoga/CompactValue.h index 9c9a92e0581..3cc36a4889e 100644 --- a/ReactCommon/yoga/yoga/CompactValue.h +++ b/ReactCommon/yoga/yoga/CompactValue.h @@ -70,7 +70,8 @@ public: template static CompactValue ofMaybe(float value) noexcept { - return std::isnan(value) ? ofUndefined() : of(value); + return std::isnan(value) || std::isinf(value) ? ofUndefined() + : of(value); } static constexpr CompactValue ofZero() noexcept {