File tree Expand file tree Collapse file tree 6 files changed +16
-1
lines changed
java/com/facebook/react/config Expand file tree Collapse file tree 6 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -284,6 +284,10 @@ - (RCTScheduler *)_createScheduler
284
284
CoreFeatures::enableClonelessStateProgression = true ;
285
285
}
286
286
287
+ if (reactNativeConfig && reactNativeConfig->getBool (" react_fabric:position_relative_default" )) {
288
+ CoreFeatures::positionRelativeDefault = true ;
289
+ }
290
+
287
291
auto componentRegistryFactory =
288
292
[factory = wrapManagedObject (_mountingManager.componentViewRegistry.componentViewFactory)](
289
293
const EventDispatcher::Weak &eventDispatcher, const ContextContainer::Shared &contextContainer) {
Original file line number Diff line number Diff line change @@ -182,4 +182,7 @@ public class ReactFeatureFlags {
182
182
* when there is work to do.
183
183
*/
184
184
public static boolean enableOnDemandReactChoreographer = false ;
185
+
186
+ /** When enabled, the default value of the position style property is relative. */
187
+ public static boolean positionRelativeDefault = false ;
185
188
}
Original file line number Diff line number Diff line change @@ -424,6 +424,8 @@ void Binding::installFabricUIManager(
424
424
getFeatureFlagValue (" enableClonelessStateProgression" );
425
425
CoreFeatures::excludeYogaFromRawProps =
426
426
getFeatureFlagValue (" excludeYogaFromRawProps" );
427
+ CoreFeatures::positionRelativeDefault =
428
+ getFeatureFlagValue (" positionRelativeDefault" );
427
429
428
430
// RemoveDelete mega-op
429
431
ShadowViewMutation::PlatformSupportsRemoveDeleteTreeInstruction =
Original file line number Diff line number Diff line change @@ -38,7 +38,9 @@ YogaStylableProps::YogaStylableProps(
38
38
/* static*/ const yoga::Style& YogaStylableProps::defaultStyle () {
39
39
static const auto defaultStyle = []() {
40
40
yoga::Style style;
41
- style.setPositionType (yoga::PositionType::Static);
41
+ style.setPositionType (
42
+ CoreFeatures::positionRelativeDefault ? yoga::PositionType::Relative
43
+ : yoga::PositionType::Static);
42
44
return style;
43
45
}();
44
46
Original file line number Diff line number Diff line change @@ -23,5 +23,6 @@ bool CoreFeatures::enableClonelessStateProgression = false;
23
23
bool CoreFeatures::excludeYogaFromRawProps = false ;
24
24
bool CoreFeatures::enableMicrotasks = false ;
25
25
bool CoreFeatures::enableReportEventPaintTime = false ;
26
+ bool CoreFeatures::positionRelativeDefault = false ;
26
27
27
28
} // namespace facebook::react
Original file line number Diff line number Diff line change @@ -67,6 +67,9 @@ class CoreFeatures {
67
67
// Report paint time inside the Event Timing API implementation
68
68
// (PerformanceObserver).
69
69
static bool enableReportEventPaintTime;
70
+
71
+ // Sets the default position of nodes to be relative instead of static
72
+ static bool positionRelativeDefault;
70
73
};
71
74
72
75
} // namespace facebook::react
You can’t perform that action at this time.
0 commit comments