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)
}