From 0ba2036e796d72994f624abc2c02689943b72c05 Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Thu, 3 Nov 2022 14:57:40 -0400 Subject: [PATCH] Remove check in renderDidSuspendDelayIfPossible I don't think we need this anymore. It was added originally because RootSuspended would take priority over RootSuspendedWithDelay. But we've since changed it: any "bad" fallback state is permitted to block a "good" fallback state. So I think we can just delete this. --- packages/react-reconciler/src/ReactFiberWorkLoop.new.js | 8 +------- packages/react-reconciler/src/ReactFiberWorkLoop.old.js | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js index 1eac6957f4e8b..a2fa1f6ae9c3f 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js @@ -1926,13 +1926,7 @@ export function renderDidSuspend(): void { } export function renderDidSuspendDelayIfPossible(): void { - if ( - workInProgressRootExitStatus === RootInProgress || - workInProgressRootExitStatus === RootSuspended || - workInProgressRootExitStatus === RootErrored - ) { - workInProgressRootExitStatus = RootSuspendedWithDelay; - } + workInProgressRootExitStatus = RootSuspendedWithDelay; // Check if there are updates that we skipped tree that might have unblocked // this render. diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.old.js b/packages/react-reconciler/src/ReactFiberWorkLoop.old.js index 0b62d0f2a3099..f08ae039c5b14 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.old.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.old.js @@ -1926,13 +1926,7 @@ export function renderDidSuspend(): void { } export function renderDidSuspendDelayIfPossible(): void { - if ( - workInProgressRootExitStatus === RootInProgress || - workInProgressRootExitStatus === RootSuspended || - workInProgressRootExitStatus === RootErrored - ) { - workInProgressRootExitStatus = RootSuspendedWithDelay; - } + workInProgressRootExitStatus = RootSuspendedWithDelay; // Check if there are updates that we skipped tree that might have unblocked // this render.