Replace usages of YGConfigSetUseLegacyStretchBehaviour (#37093)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37093

This replaces product usages of `YGConfigSetUseLegacyStretchBehaviour` with instead setting `YGErrataAll`, to opt out of future conformance fixes which may impact compatibility.

We need to still audit C/C++ usage for where we should be applying `YGErrataClassic`, port this change to the RN desktop fork, then mark the function as deprecated (taking care to allow deprecated functions in the Yoga bindings to call deprecated C ABI functions without warning).

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D45300631

fbshipit-source-id: 9f94bdbbe7eda091adac016231083b2486c583d9
This commit is contained in:
Nick Gerleman
2023-04-27 12:32:28 -07:00
committed by Facebook GitHub Bot
parent f635341461
commit b0cf746c1f
2 changed files with 2 additions and 2 deletions
@@ -50,7 +50,7 @@ typedef NS_ENUM(unsigned int, meta_prop_t) {
dispatch_once(&onceToken, ^{
yogaConfig = YGConfigNew();
YGConfigSetPointScaleFactor(yogaConfig, RCTScreenScale());
YGConfigSetUseLegacyStretchBehaviour(yogaConfig, true);
YGConfigSetErrata(yogaConfig, YGErrataAll);
});
return yogaConfig;
}
@@ -745,7 +745,7 @@ YogaLayoutableShadowNode &YogaLayoutableShadowNode::shadowNodeFromContext(
YGConfig &YogaLayoutableShadowNode::initializeYogaConfig(YGConfig &config) {
YGConfigSetCloneNodeFunc(
&config, YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector);
YGConfigSetUseLegacyStretchBehaviour(&config, true);
YGConfigSetErrata(&config, YGErrataAll);
#ifdef RN_DEBUG_YOGA_LOGGER
YGConfigSetPrintTreeFlag(&config, true);
#endif