From ae0632d01daf46cc48263bfc118c4b38406f4d8a Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Tue, 17 Oct 2023 18:12:13 -0700 Subject: [PATCH] Remove treatAutoAsYGValueUndefined flag (#41033) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/41033 This has been rolled out with the false value (previous client-default of false). The open-source value was already false. Changelog: [Internal] Reviewed By: NickGerleman, sammy-SC Differential Revision: D50362517 fbshipit-source-id: 577a2ead047b30d196409a26fd5385f333f20b18 --- .../renderer/components/view/conversions.h | 3 +-- .../renderer/core/PropsParserContext.cpp | 27 ------------------- .../react/renderer/core/PropsParserContext.h | 6 ----- 3 files changed, 1 insertion(+), 35 deletions(-) delete mode 100644 packages/react-native/ReactCommon/react/renderer/core/PropsParserContext.cpp diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/conversions.h b/packages/react-native/ReactCommon/react/renderer/components/view/conversions.h index e38ab6b7b51..b2e8febb602 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/conversions.h +++ b/packages/react-native/ReactCommon/react/renderer/components/view/conversions.h @@ -398,8 +398,7 @@ inline void fromRawValue( } else if (value.hasType()) { const auto stringValue = (std::string)value; if (stringValue == "auto") { - result = context.treatAutoAsYGValueUndefined() ? YGValueUndefined - : YGValueAuto; + result = YGValueAuto; return; } else { if (stringValue.back() == '%') { diff --git a/packages/react-native/ReactCommon/react/renderer/core/PropsParserContext.cpp b/packages/react-native/ReactCommon/react/renderer/core/PropsParserContext.cpp deleted file mode 100644 index 0ceb9fe39e8..00000000000 --- a/packages/react-native/ReactCommon/react/renderer/core/PropsParserContext.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#include "PropsParserContext.h" - -#include - -namespace facebook::react { - -bool PropsParserContext::treatAutoAsYGValueUndefined() const { - if (treatAutoAsYGValueUndefined_ == std::nullopt) { - auto config = - contextContainer.find>( - "ReactNativeConfig"); - treatAutoAsYGValueUndefined_ = config && *config != nullptr - ? (*config)->getBool("react_fabric:treat_auto_as_undefined") - : false; - } - - return *treatAutoAsYGValueUndefined_; -} - -} // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/core/PropsParserContext.h b/packages/react-native/ReactCommon/react/renderer/core/PropsParserContext.h index 9d733c7f671..dee30506aa3 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/PropsParserContext.h +++ b/packages/react-native/ReactCommon/react/renderer/core/PropsParserContext.h @@ -29,12 +29,6 @@ struct PropsParserContext { const SurfaceId surfaceId; const ContextContainer& contextContainer; - - // Temporary feature flags - bool treatAutoAsYGValueUndefined() const; - - private: - mutable std::optional treatAutoAsYGValueUndefined_; }; } // namespace facebook::react