Skip to content

Commit

Permalink
Replace usages of YGConfigSetUseLegacyStretchBehaviour (#37093)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
NickGerleman authored and facebook-github-bot committed Apr 27, 2023
1 parent f635341 commit b0cf746
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/react-native/React/Views/RCTShadowView.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ + (YGConfigRef)yogaConfig
dispatch_once(&onceToken, ^{
yogaConfig = YGConfigNew();
YGConfigSetPointScaleFactor(yogaConfig, RCTScreenScale());
YGConfigSetUseLegacyStretchBehaviour(yogaConfig, true);
YGConfigSetErrata(yogaConfig, YGErrataAll);
});
return yogaConfig;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b0cf746

Please sign in to comment.