diff --git a/packages/react-reconciler/src/ReactFiberCommitWork.js b/packages/react-reconciler/src/ReactFiberCommitWork.js index fdd289d93280f..360bab6552f44 100644 --- a/packages/react-reconciler/src/ReactFiberCommitWork.js +++ b/packages/react-reconciler/src/ReactFiberCommitWork.js @@ -53,8 +53,8 @@ import { enableUseEffectEventHook, enableFloat, enableLegacyHidden, - alwaysThrottleRetries, disableStringRefs, + throttleDisappearingFallbacks, } from 'shared/ReactFeatureFlags'; import { FunctionComponent, @@ -2896,7 +2896,7 @@ function commitMutationEffectsOnFiber( current !== null && (current.memoizedState: SuspenseState | null) !== null; - if (alwaysThrottleRetries) { + if (throttleDisappearingFallbacks) { if (isShowingFallback !== wasShowingFallback) { // A fallback is either appearing or disappearing. markCommitTimeOfFallback(); diff --git a/packages/shared/ReactFeatureFlags.js b/packages/shared/ReactFeatureFlags.js index 0e88a9674dcf8..0331db64de255 100644 --- a/packages/shared/ReactFeatureFlags.js +++ b/packages/shared/ReactFeatureFlags.js @@ -115,6 +115,8 @@ export const enableFizzExternalRuntime = true; export const alwaysThrottleRetries = true; +export const throttleDisappearingFallbacks = true; + export const useMicrotasksForSchedulingInFabric = false; export const passChildrenWhenCloningPersistedNodes = false; diff --git a/packages/shared/forks/ReactFeatureFlags.native-fb-dynamic.js b/packages/shared/forks/ReactFeatureFlags.native-fb-dynamic.js index e88628506b690..cb11de82b7830 100644 --- a/packages/shared/forks/ReactFeatureFlags.native-fb-dynamic.js +++ b/packages/shared/forks/ReactFeatureFlags.native-fb-dynamic.js @@ -30,6 +30,7 @@ export const enableRenderableContext = __VARIANT__; export const enableUnifiedSyncLane = __VARIANT__; export const enableUseRefAccessWarning = __VARIANT__; export const passChildrenWhenCloningPersistedNodes = __VARIANT__; +export const throttleDisappearingFallbacks = __VARIANT__; export const useMicrotasksForSchedulingInFabric = __VARIANT__; export const useModernStrictMode = __VARIANT__; diff --git a/packages/shared/forks/ReactFeatureFlags.native-fb.js b/packages/shared/forks/ReactFeatureFlags.native-fb.js index a9e0348ebad76..ac55a3fbf62e2 100644 --- a/packages/shared/forks/ReactFeatureFlags.native-fb.js +++ b/packages/shared/forks/ReactFeatureFlags.native-fb.js @@ -28,6 +28,7 @@ export const { enableUnifiedSyncLane, enableUseRefAccessWarning, passChildrenWhenCloningPersistedNodes, + throttleDisappearingFallbacks, useMicrotasksForSchedulingInFabric, useModernStrictMode, } = dynamicFlags; diff --git a/packages/shared/forks/ReactFeatureFlags.native-oss.js b/packages/shared/forks/ReactFeatureFlags.native-oss.js index 6f487a7c275e7..61191cacb1126 100644 --- a/packages/shared/forks/ReactFeatureFlags.native-oss.js +++ b/packages/shared/forks/ReactFeatureFlags.native-oss.js @@ -79,6 +79,7 @@ export const enableInfiniteRenderLoopDetection = false; export const enableAsyncActions = false; export const alwaysThrottleRetries = false; +export const throttleDisappearingFallbacks = false; export const useMicrotasksForSchedulingInFabric = false; export const passChildrenWhenCloningPersistedNodes = false; diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.js index fc05a456821f4..9d2f9cb0ac1c4 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.js @@ -77,6 +77,7 @@ export const enableDeferRootSchedulingToMicrotask = true; export const enableAsyncActions = true; export const alwaysThrottleRetries = true; +export const throttleDisappearingFallbacks = true; export const useMicrotasksForSchedulingInFabric = false; export const passChildrenWhenCloningPersistedNodes = false; diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js index ad8a03ae72438..9b970b6dab1cc 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js @@ -77,6 +77,7 @@ export const enableDeferRootSchedulingToMicrotask = false; export const enableAsyncActions = true; export const alwaysThrottleRetries = true; +export const throttleDisappearingFallbacks = true; export const useMicrotasksForSchedulingInFabric = false; export const passChildrenWhenCloningPersistedNodes = false; diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js index 8a33eb72270a6..ba8168a98ad06 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js @@ -78,6 +78,7 @@ export const enableDeferRootSchedulingToMicrotask = true; export const enableAsyncActions = true; export const alwaysThrottleRetries = true; +export const throttleDisappearingFallbacks = true; export const useMicrotasksForSchedulingInFabric = false; export const passChildrenWhenCloningPersistedNodes = false; diff --git a/packages/shared/forks/ReactFeatureFlags.www-dynamic.js b/packages/shared/forks/ReactFeatureFlags.www-dynamic.js index 7343b8c1c4732..bbcaaa6932aaa 100644 --- a/packages/shared/forks/ReactFeatureFlags.www-dynamic.js +++ b/packages/shared/forks/ReactFeatureFlags.www-dynamic.js @@ -24,6 +24,7 @@ export const enableUnifiedSyncLane = __VARIANT__; export const enableTransitionTracing = __VARIANT__; export const enableDeferRootSchedulingToMicrotask = __VARIANT__; export const alwaysThrottleRetries = __VARIANT__; +export const throttleDisappearingFallbacks = __VARIANT__; export const enableDO_NOT_USE_disableStrictPassiveEffect = __VARIANT__; export const enableUseDeferredValueInitialArg = __VARIANT__; export const enableRenderableContext = __VARIANT__; diff --git a/packages/shared/forks/ReactFeatureFlags.www.js b/packages/shared/forks/ReactFeatureFlags.www.js index 105e3fd806025..685b117986191 100644 --- a/packages/shared/forks/ReactFeatureFlags.www.js +++ b/packages/shared/forks/ReactFeatureFlags.www.js @@ -27,6 +27,7 @@ export const { enableTransitionTracing, enableDeferRootSchedulingToMicrotask, alwaysThrottleRetries, + throttleDisappearingFallbacks, enableDO_NOT_USE_disableStrictPassiveEffect, disableSchedulerTimeoutInWorkLoop, enableUseDeferredValueInitialArg, diff --git a/scripts/flow/xplat.js b/scripts/flow/xplat.js index 0df7886173b19..0e6aa5f961bbe 100644 --- a/scripts/flow/xplat.js +++ b/scripts/flow/xplat.js @@ -18,6 +18,7 @@ declare module 'ReactNativeInternalFeatureFlags' { declare export var enableUnifiedSyncLane: boolean; declare export var enableUseRefAccessWarning: boolean; declare export var passChildrenWhenCloningPersistedNodes: boolean; + declare export var throttleDisappearingFallbacks: boolean; declare export var useMicrotasksForSchedulingInFabric: boolean; declare export var useModernStrictMode: boolean; }