-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor MobileConfig Access for "react_fabric: treat_auto_as_undefin…
…ed" (#37208) Summary: Pull Request resolved: #37208 Reviewed By: javache Differential Revision: D45434603 fbshipit-source-id: 9081ea11c87a05e0d8ff95e55d8aa8bcd52b4c39
- Loading branch information
1 parent
bde38d5
commit e1876af
Showing
4 changed files
with
42 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
packages/react-native/ReactCommon/react/renderer/core/PropsParserContext.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* 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.at<std::shared_ptr<const ReactNativeConfig>>( | ||
"ReactNativeConfig"); | ||
treatAutoAsYGValueUndefined_ = config | ||
? config->getBool("react_fabric:treat_auto_as_undefined") | ||
: false; | ||
} | ||
|
||
return *treatAutoAsYGValueUndefined_; | ||
} | ||
|
||
} // namespace facebook::react |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters