Skip to content

Commit ea17ef8

Browse files
javachemeta-codesync[bot]
authored andcommitted
Default fixDifferentiatorParentTagForUnflattenCase to true with MC opt-out (#57220)
Summary: Pull Request resolved: #57220 Flip the React Native feature flag `fixDifferentiatorParentTagForUnflattenCase` default to `true` so the differentiator `parentTag` fix is on by default across all platforms Changelog: [Internal] Wire fbios + fb4a to MobileConfig params so we can opt out server-side if needed. Because the MC defaults are `true`, the feature activates for all FB-app users on land; setting the param to `false` server-side is the kill switch. Reviewed By: zeyap Differential Revision: D108613362 fbshipit-source-id: 6ffa21774582d5b8d83192fc65a964142b87b88e
1 parent 74fdfd1 commit ea17ef8

5 files changed

Lines changed: 17 additions & 9 deletions

File tree

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<061d668cf04041f4d3d2f48f11dc739f>>
7+
* @generated SignedSource<<ad505c0c71fa0c6e665a218606b596da>>
88
*/
99

1010
/**
@@ -127,7 +127,7 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
127127

128128
override fun enableVirtualViewContainerStateExperimental(): Boolean = false
129129

130-
override fun fixDifferentiatorParentTagForUnflattenCase(): Boolean = false
130+
override fun fixDifferentiatorParentTagForUnflattenCase(): Boolean = true
131131

132132
override fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean = false
133133

packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<8dfc52502bd539e5e43d547f895a6d33>>
7+
* @generated SignedSource<<f1921c6321439d8354f90ff261c15cd5>>
88
*/
99

1010
/**
@@ -236,7 +236,7 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
236236
}
237237

238238
bool fixDifferentiatorParentTagForUnflattenCase() override {
239-
return false;
239+
return true;
240240
}
241241

242242
bool fixMappingOfEventPrioritiesBetweenFabricAndReact() override {

packages/react-native/ReactCommon/react/renderer/mounting/tests/DifferentiatorUnflattenTest.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,14 @@ namespace {
2727

2828
class TestFlagsWithUnflattenFix : public ReactNativeFeatureFlagsDefaults {
2929
public:
30+
explicit TestFlagsWithUnflattenFix(bool enabled) : enabled_(enabled) {}
31+
3032
bool fixDifferentiatorParentTagForUnflattenCase() override {
31-
return true;
33+
return enabled_;
3234
}
35+
36+
private:
37+
bool enabled_;
3338
};
3439

3540
} // namespace
@@ -164,6 +169,9 @@ class DifferentiatorUnflattenTest : public ::testing::Test {
164169
TEST_F(
165170
DifferentiatorUnflattenTest,
166171
withoutFix_updateMutationHasWrongParentTag) {
172+
ReactNativeFeatureFlags::dangerouslyForceOverride(
173+
std::make_unique<TestFlagsWithUnflattenFix>(false));
174+
167175
applyUnflattenSetup_();
168176

169177
auto mutations = calculateMutations_();
@@ -186,7 +194,7 @@ TEST_F(
186194
// as parentTag, and StubViewTree::mutate() succeeds without assertion failure.
187195
TEST_F(DifferentiatorUnflattenTest, withFix_updateMutationHasCorrectParentTag) {
188196
ReactNativeFeatureFlags::dangerouslyForceOverride(
189-
std::make_unique<TestFlagsWithUnflattenFix>());
197+
std::make_unique<TestFlagsWithUnflattenFix>(true));
190198

191199
applyUnflattenSetup_();
192200

packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ const definitions: FeatureFlagDefinitions = {
605605
ossReleaseStage: 'none',
606606
},
607607
fixDifferentiatorParentTagForUnflattenCase: {
608-
defaultValue: false,
608+
defaultValue: true,
609609
metadata: {
610610
dateAdded: '2026-04-18',
611611
description:

packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<609451fd0a38e0f8eaf685e7cf534e27>>
7+
* @generated SignedSource<<3304b4ee2c718dbf4d56b607ea09054d>>
88
* @flow strict
99
* @noformat
1010
*/
@@ -424,7 +424,7 @@ export const enableVirtualViewContainerStateExperimental: Getter<boolean> = crea
424424
/**
425425
* Fix incorrect parentTag passed as parentTagForUpdate in the unflatten-unflatten branch of calculateShadowViewMutationsFlattener, which causes UPDATE mutations to reference a parent being created in the same batch.
426426
*/
427-
export const fixDifferentiatorParentTagForUnflattenCase: Getter<boolean> = createNativeFlagGetter('fixDifferentiatorParentTagForUnflattenCase', false);
427+
export const fixDifferentiatorParentTagForUnflattenCase: Getter<boolean> = createNativeFlagGetter('fixDifferentiatorParentTagForUnflattenCase', true);
428428
/**
429429
* Uses the default event priority instead of the discreet event priority by default when dispatching events from Fabric to React.
430430
*/

0 commit comments

Comments
 (0)