Skip to content

Commit 74dd2da

Browse files
authored
[flags] Remove enableModernStrictMode (#31838)
This is enabled everywhere.
1 parent e1d843f commit 74dd2da

11 files changed

+22
-45
lines changed

packages/react-reconciler/src/ReactFiberWorkLoop.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import {
3232
enableSchedulingProfiler,
3333
enableUpdaterTracking,
3434
enableTransitionTracing,
35-
useModernStrictMode,
3635
disableLegacyContext,
3736
alwaysThrottleRetries,
3837
enableInfiniteRenderLoopDetection,
@@ -4205,7 +4204,7 @@ function commitDoubleInvokeEffectsInDEV(
42054204
hasPassiveEffects: boolean,
42064205
) {
42074206
if (__DEV__) {
4208-
if (useModernStrictMode && (disableLegacyMode || root.tag !== LegacyRoot)) {
4207+
if (disableLegacyMode || root.tag !== LegacyRoot) {
42094208
let doubleInvokeEffects = true;
42104209

42114210
if (

packages/react-reconciler/src/__tests__/ActivityStrictMode-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe('Activity StrictMode', () => {
7777
]);
7878
});
7979

80-
// @gate __DEV__ && enableActivity && useModernStrictMode
80+
// @gate __DEV__ && enableActivity
8181
it('should not trigger strict effects when offscreen is hidden', async () => {
8282
await act(() => {
8383
ReactNoop.render(

packages/react-reconciler/src/__tests__/StrictEffectsMode-test.js

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -945,34 +945,25 @@ describe('StrictEffectsMode', () => {
945945
shouldSuspend = false;
946946
});
947947

948-
if (gate(flags => flags.useModernStrictMode)) {
949-
expect(log).toEqual([
950-
'Child rendered',
951-
'Child rendered',
952-
// !!! Committed, destroy and create effect.
953-
// !!! The other effect is not destroyed and created
954-
// !!! because the dep didn't change
955-
'Child dep destroy',
956-
'Child dep create',
957-
958-
// Double invoke both effects
959-
'Child destroy',
960-
'Child dep destroy',
961-
'Child create',
962-
'Child dep create',
963-
// Fires setState
964-
'-----------------------after setState',
965-
'Child rendered',
966-
'Child rendered',
967-
'Child dep create',
968-
]);
969-
} else {
970-
expect(log).toEqual([
971-
'Child rendered',
972-
'Child rendered',
973-
'Child dep destroy',
974-
'Child dep create',
975-
]);
976-
}
948+
expect(log).toEqual([
949+
'Child rendered',
950+
'Child rendered',
951+
// !!! Committed, destroy and create effect.
952+
// !!! The other effect is not destroyed and created
953+
// !!! because the dep didn't change
954+
'Child dep destroy',
955+
'Child dep create',
956+
957+
// Double invoke both effects
958+
'Child destroy',
959+
'Child dep destroy',
960+
'Child create',
961+
'Child dep create',
962+
// Fires setState
963+
'-----------------------after setState',
964+
'Child rendered',
965+
'Child rendered',
966+
'Child dep create',
967+
]);
977968
});
978969
});

packages/react-reconciler/src/__tests__/StrictEffectsModeDefaults-test.internal.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,6 @@ describe('StrictEffectsMode defaults', () => {
461461
expect(log).toEqual([]);
462462
});
463463

464-
//@gate useModernStrictMode
465464
it('disconnects refs during double invoking', async () => {
466465
const onRefMock = jest.fn();
467466
function App({text}) {

packages/shared/ReactFeatureFlags.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,6 @@ export const disableLegacyContext = true;
186186
*/
187187
export const disableLegacyContextForFunctionComponents = true;
188188

189-
// Not ready to break experimental yet.
190-
// Modern <StrictMode /> behaviour aligns more with what components
191-
// components will encounter in production, especially when used With <Offscreen />.
192-
// TODO: clean up legacy <StrictMode /> once tests pass WWW.
193-
export const useModernStrictMode = true;
194-
195189
// Enable the moveBefore() alternative to insertBefore(). This preserves states of moves.
196190
export const enableMoveBefore = false;
197191

packages/shared/forks/ReactFeatureFlags.native-fb.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ export const renameElementSymbol = false;
8080
export const retryLaneExpirationMs = 5000;
8181
export const syncLaneExpirationMs = 250;
8282
export const transitionLaneExpirationMs = 5000;
83-
export const useModernStrictMode = true;
8483
export const enableHydrationLaneScheduling = true;
8584
export const enableYieldingBeforePassive = false;
8685

packages/shared/forks/ReactFeatureFlags.native-oss.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ export const renameElementSymbol = true;
7070
export const retryLaneExpirationMs = 5000;
7171
export const syncLaneExpirationMs = 250;
7272
export const transitionLaneExpirationMs = 5000;
73-
export const useModernStrictMode = true;
7473
export const enableSiblingPrerendering = true;
7574
export const enableUseResourceEffectHook = false;
7675

packages/shared/forks/ReactFeatureFlags.test-renderer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ export const enableLegacyHidden = false;
5252

5353
export const enableTransitionTracing = false;
5454

55-
export const useModernStrictMode = true;
5655
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
5756
export const enableFizzExternalRuntime = true;
5857
export const enableDeferRootSchedulingToMicrotask = true;

packages/shared/forks/ReactFeatureFlags.test-renderer.native-fb.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ export const renameElementSymbol = false;
6565
export const retryLaneExpirationMs = 5000;
6666
export const syncLaneExpirationMs = 250;
6767
export const transitionLaneExpirationMs = 5000;
68-
export const useModernStrictMode = true;
6968
export const enableFabricCompleteRootInCommitPhase = false;
7069
export const enableSiblingPrerendering = true;
7170
export const enableUseResourceEffectHook = true;

packages/shared/forks/ReactFeatureFlags.test-renderer.www.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ export const enableLegacyHidden = false;
5454

5555
export const enableTransitionTracing = false;
5656

57-
export const useModernStrictMode = true;
5857
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
5958
export const enableFizzExternalRuntime = false;
6059
export const enableDeferRootSchedulingToMicrotask = true;

packages/shared/forks/ReactFeatureFlags.www.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ export const disableClientCache = true;
106106
export const enableServerComponentLogs = true;
107107

108108
export const enableReactTestRendererWarning = false;
109-
export const useModernStrictMode = true;
110109

111110
export const disableLegacyMode = true;
112111

0 commit comments

Comments
 (0)