From 5966fec206b689b970a937e89cbbd34a12ed013b Mon Sep 17 00:00:00 2001 From: daiwei Date: Tue, 10 Jun 2025 11:26:36 +0800 Subject: [PATCH] fix(suspense): don't immediately resolve suspense on last dep unmount because new vnodes may contain async components --- packages/runtime-core/src/renderer.ts | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/packages/runtime-core/src/renderer.ts b/packages/runtime-core/src/renderer.ts index a57be791a4..16ed847076 100644 --- a/packages/runtime-core/src/renderer.ts +++ b/packages/runtime-core/src/renderer.ts @@ -2332,24 +2332,6 @@ function baseCreateRenderer( instance.isUnmounted = true }, parentSuspense) - // A component with async dep inside a pending suspense is unmounted before - // its async dep resolves. This should remove the dep from the suspense, and - // cause the suspense to resolve immediately if that was the last dep. - if ( - __FEATURE_SUSPENSE__ && - parentSuspense && - parentSuspense.pendingBranch && - !parentSuspense.isUnmounted && - instance.asyncDep && - !instance.asyncResolved && - instance.suspenseId === parentSuspense.pendingId - ) { - parentSuspense.deps-- - if (parentSuspense.deps === 0) { - parentSuspense.resolve() - } - } - if (__DEV__ || __FEATURE_PROD_DEVTOOLS__) { devtoolsComponentRemoved(instance) } -- 2.47.2