Skip to content

Commit 5966fec

Browse files
committed
fix(suspense): don't immediately resolve suspense on last dep unmount
because new vnodes may contain async components
1 parent cdffaf6 commit 5966fec

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

packages/runtime-core/src/renderer.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2332,24 +2332,6 @@ function baseCreateRenderer(
23322332
instance.isUnmounted = true
23332333
}, parentSuspense)
23342334

2335-
// A component with async dep inside a pending suspense is unmounted before
2336-
// its async dep resolves. This should remove the dep from the suspense, and
2337-
// cause the suspense to resolve immediately if that was the last dep.
2338-
if (
2339-
__FEATURE_SUSPENSE__ &&
2340-
parentSuspense &&
2341-
parentSuspense.pendingBranch &&
2342-
!parentSuspense.isUnmounted &&
2343-
instance.asyncDep &&
2344-
!instance.asyncResolved &&
2345-
instance.suspenseId === parentSuspense.pendingId
2346-
) {
2347-
parentSuspense.deps--
2348-
if (parentSuspense.deps === 0) {
2349-
parentSuspense.resolve()
2350-
}
2351-
}
2352-
23532335
if (__DEV__ || __FEATURE_PROD_DEVTOOLS__) {
23542336
devtoolsComponentRemoved(instance)
23552337
}

0 commit comments

Comments
 (0)