Skip to content

Commit a338298

Browse files
committed
Remove dead suspense optimization
1 parent 4e598ef commit a338298

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

packages/react-reconciler/src/ReactFiberWorkLoop.js

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,27 +2047,13 @@ function handleThrow(root: FiberRoot, thrownValue: any): void {
20472047
// API for suspending. This implementation detail can change later, once we
20482048
// deprecate the old API in favor of `use`.
20492049
thrownValue = getSuspendedThenable();
2050-
workInProgressSuspendedReason =
2051-
// TODO: Suspending the work loop during the render phase is
2052-
// currently not compatible with sibling prerendering. We will add
2053-
// this optimization back in a later step.
2054-
false &&
2055-
shouldRemainOnPreviousScreen() &&
2056-
// Check if there are other pending updates that might possibly unblock this
2057-
// component from suspending. This mirrors the check in
2058-
// renderDidSuspendDelayIfPossible. We should attempt to unify them somehow.
2059-
// TODO: Consider unwinding immediately, using the
2060-
// SuspendedOnHydration mechanism.
2061-
!includesNonIdleWork(workInProgressRootSkippedLanes) &&
2062-
!includesNonIdleWork(workInProgressRootInterleavedUpdatedLanes)
2063-
? // Suspend work loop until data resolves
2064-
thrownValue === SuspenseActionException
2065-
? SuspendedOnAction
2066-
: SuspendedOnData
2067-
: // Don't suspend work loop, except to check if the data has
2068-
// immediately resolved (i.e. in a microtask). Otherwise, trigger the
2069-
// nearest Suspense fallback.
2070-
SuspendedOnImmediate;
2050+
// TODO: Suspending the work loop during the render phase is
2051+
// currently not compatible with sibling prerendering. We will add
2052+
// this optimization back in a later step.
2053+
// Don't suspend work loop, except to check if the data has
2054+
// immediately resolved (i.e. in a microtask). Otherwise, trigger the
2055+
// nearest Suspense fallback.
2056+
workInProgressSuspendedReason = SuspendedOnImmediate;
20712057
} else if (thrownValue === SuspenseyCommitException) {
20722058
thrownValue = getSuspendedThenable();
20732059
workInProgressSuspendedReason = SuspendedOnInstance;

0 commit comments

Comments
 (0)