diff --git a/ReactCommon/fabric/components/view/conversions.h b/ReactCommon/fabric/components/view/conversions.h index 753e2ac762..c8d9b9a035 100644 --- a/ReactCommon/fabric/components/view/conversions.h +++ b/ReactCommon/fabric/components/view/conversions.h @@ -302,9 +302,7 @@ inline void fromRawValue(const RawValue &value, YGDisplay &result) { LOG(FATAL) << "Could not parse YGDisplay:" << stringValue; } -inline void fromRawValue( - const RawValue &value, - decltype(YGStyle{}.margin()[0]) /* type is subject to change */ &result) { +inline void fromRawValue(const RawValue &value, YGStyle::ValueRepr &result) { if (value.hasType()) { result = yogaStyleValueFromFloat((Float)value); return; diff --git a/ReactCommon/yoga/yoga/YGStyle.h b/ReactCommon/yoga/yoga/YGStyle.h index dd94683224..953c6ae8f5 100644 --- a/ReactCommon/yoga/yoga/YGStyle.h +++ b/ReactCommon/yoga/yoga/YGStyle.h @@ -7,7 +7,7 @@ #pragma once #include #include -#include +#include #include "CompactValue.h" #include "YGEnums.h" #include "YGFloatOptional.h" @@ -171,6 +171,10 @@ private: BITFIELD_ACCESSORS(flexWrap); BITFIELD_ACCESSORS(overflow); BITFIELD_ACCESSORS(display); + +public: + // for library users needing a type + using ValueRepr = std::remove_reference::type; }; bool operator==(const YGStyle& lhs, const YGStyle& rhs);