Skip to content

Commit

Permalink
Replace usages of YGConfigSetUseLegacyStretchBehaviour
Browse files Browse the repository at this point in the history
Summary:
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]

Differential Revision: D45300631

fbshipit-source-id: 4e09ec9dcfcb57b07232aa57ef7b0c1436e9a241
  • Loading branch information
NickGerleman authored and facebook-github-bot committed Apr 27, 2023
1 parent 4b25c99 commit f19de94
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 f19de94

Please sign in to comment.