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
This commit is contained in:
Pieter De Baets
2023-10-17 18:12:13 -07:00
committed by Facebook GitHub Bot
parent 2018a82a53
commit ae0632d01d
3 changed files with 1 additions and 35 deletions
@@ -398,8 +398,7 @@ inline void fromRawValue(
} else if (value.hasType<std::string>()) {
const auto stringValue = (std::string)value;
if (stringValue == "auto") {
result = context.treatAutoAsYGValueUndefined() ? YGValueUndefined
: YGValueAuto;
result = YGValueAuto;
return;
} else {
if (stringValue.back() == '%') {
@@ -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 <react/config/ReactNativeConfig.h>
namespace facebook::react {
bool PropsParserContext::treatAutoAsYGValueUndefined() const {
if (treatAutoAsYGValueUndefined_ == std::nullopt) {
auto config =
contextContainer.find<std::shared_ptr<const ReactNativeConfig>>(
"ReactNativeConfig");
treatAutoAsYGValueUndefined_ = config && *config != nullptr
? (*config)->getBool("react_fabric:treat_auto_as_undefined")
: false;
}
return *treatAutoAsYGValueUndefined_;
}
} // namespace facebook::react
@@ -29,12 +29,6 @@ struct PropsParserContext {
const SurfaceId surfaceId;
const ContextContainer& contextContainer;
// Temporary feature flags
bool treatAutoAsYGValueUndefined() const;
private:
mutable std::optional<bool> treatAutoAsYGValueUndefined_;
};
} // namespace facebook::react