From 2a15f9190266d90abbe3fc7e5437ea77e99e4290 Mon Sep 17 00:00:00 2001 From: Nishan Date: Wed, 14 Dec 2022 10:13:03 +0530 Subject: [PATCH 1/2] fix: margin auto conversion in fabric --- ReactCommon/react/renderer/components/view/conversions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactCommon/react/renderer/components/view/conversions.h b/ReactCommon/react/renderer/components/view/conversions.h index 1fa108b5fb5775..66e8301c229020 100644 --- a/ReactCommon/react/renderer/components/view/conversions.h +++ b/ReactCommon/react/renderer/components/view/conversions.h @@ -382,7 +382,7 @@ inline void fromRawValue( } else if (value.hasType()) { const auto stringValue = (std::string)value; if (stringValue == "auto") { - result = YGValueUndefined; + result = YGValueAuto; return; } else { if (stringValue.back() == '%') { From 473179f6caab7cbb4b9e9c3b10a39f110d182945 Mon Sep 17 00:00:00 2001 From: Nishan Date: Thu, 15 Dec 2022 16:21:18 +0530 Subject: [PATCH 2/2] feature flag auto --- ReactCommon/react/renderer/components/view/conversions.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ReactCommon/react/renderer/components/view/conversions.h b/ReactCommon/react/renderer/components/view/conversions.h index 66e8301c229020..1c1a7393018af3 100644 --- a/ReactCommon/react/renderer/components/view/conversions.h +++ b/ReactCommon/react/renderer/components/view/conversions.h @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -382,7 +383,8 @@ inline void fromRawValue( } else if (value.hasType()) { const auto stringValue = (std::string)value; if (stringValue == "auto") { - result = YGValueAuto; + auto reactNativeConfig = context.contextContainer.at>("ReactNativeConfig"); + result = reactNativeConfig->getBool("react_fabric:treat_auto_as_undefined") ? YGValueUndefined : YGValueAuto; return; } else { if (stringValue.back() == '%') {