Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/runtime-core/src/components/Suspense.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ export interface SuspenseBoundary {
registerDep(
instance: ComponentInternalInstance,
setupRenderEffect: SetupRenderEffectFn,
optimized: boolean,
): void
unmount(parentSuspense: SuspenseBoundary | null, doRemove?: boolean): void
}
Expand Down Expand Up @@ -679,7 +680,7 @@ function createSuspenseBoundary(
return suspense.activeBranch && next(suspense.activeBranch)
},

registerDep(instance, setupRenderEffect) {
registerDep(instance, setupRenderEffect, optimized) {
const isInPendingSuspense = !!suspense.pendingBranch
if (isInPendingSuspense) {
suspense.deps++
Expand Down
3 changes: 2 additions & 1 deletion packages/runtime-core/src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,8 @@ function baseCreateRenderer(
// setup() is async. This component relies on async logic to be resolved
// before proceeding
if (__FEATURE_SUSPENSE__ && instance.asyncDep) {
parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect)
parentSuspense &&
parentSuspense.registerDep(instance, setupRenderEffect, optimized)

// Give it a placeholder if this is not hydration
// TODO handle self-defined fallback
Expand Down