From 975cea2d3ddb95ad31f10ae112bdde5101725c85 Mon Sep 17 00:00:00 2001 From: Ricky Date: Mon, 16 Dec 2024 22:52:18 -0500 Subject: [PATCH] Enable debugRenderPhaseSideEffectsForStrictMode in test renderers (#31761) This flag controls the strict mode double invoke render/lifecycles/etc behavior in Strict Mode. The only place this flag is off is the test renderers, which it should be on for. If we can land this, we can follow up to remove the flag. --- packages/shared/forks/ReactFeatureFlags.test-renderer.js | 2 +- .../shared/forks/ReactFeatureFlags.test-renderer.native-fb.js | 2 +- packages/shared/forks/ReactFeatureFlags.test-renderer.www.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.js index 8281009889b21..53057d78d7390 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.js @@ -10,7 +10,7 @@ import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags'; import typeof * as ExportsType from './ReactFeatureFlags.test-renderer'; -export const debugRenderPhaseSideEffectsForStrictMode = false; +export const debugRenderPhaseSideEffectsForStrictMode = __DEV__; export const enableAsyncDebugInfo = false; export const enableSchedulingProfiler = false; export const enableProfilerTimer = __PROFILE__; diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.native-fb.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.native-fb.js index 8f71306c51a62..66e4329cb829d 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.native-fb.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.native-fb.js @@ -11,7 +11,7 @@ import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags'; import typeof * as ExportsType from './ReactFeatureFlags.test-renderer'; export const alwaysThrottleRetries = false; -export const debugRenderPhaseSideEffectsForStrictMode = false; +export const debugRenderPhaseSideEffectsForStrictMode = __DEV__; export const disableClientCache = true; export const disableCommentsAsDOMContainers = true; export const disableDefaultPropsExceptForClasses = true; diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js index 233a847ec37f7..b71ff7a266b4a 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js @@ -10,7 +10,7 @@ import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags'; import typeof * as ExportsType from './ReactFeatureFlags.test-renderer.www'; -export const debugRenderPhaseSideEffectsForStrictMode = false; +export const debugRenderPhaseSideEffectsForStrictMode = __DEV__; export const enableAsyncDebugInfo = false; export const enableSchedulingProfiler = false; export const enableProfilerTimer = __PROFILE__;