Skip to content

Commit 141a5e1

Browse files
committed
fix(suspense): fix suspense slot inside deoptimized slot call
fix #4556
1 parent 93949ed commit 141a5e1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/runtime-core/src/components/Suspense.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import {
77
closeBlock,
88
currentBlock,
99
Comment,
10-
createVNode
10+
createVNode,
11+
isBlockTreeEnabled
1112
} from '../vnode'
1213
import { isFunction, isArray, ShapeFlags, toNumber } from '@vue/shared'
1314
import { ComponentInternalInstance, handleSetupResult } from '../component'
@@ -727,16 +728,16 @@ function normalizeSuspenseChildren(vnode: VNode) {
727728
function normalizeSuspenseSlot(s: any) {
728729
let block: VNode[] | null | undefined
729730
if (isFunction(s)) {
730-
const isCompiledSlot = s._c
731-
if (isCompiledSlot) {
731+
const trackBlock = isBlockTreeEnabled && s._c
732+
if (trackBlock) {
732733
// disableTracking: false
733734
// allow block tracking for compiled slots
734735
// (see ./componentRenderContext.ts)
735736
s._d = false
736737
openBlock()
737738
}
738739
s = s()
739-
if (isCompiledSlot) {
740+
if (trackBlock) {
740741
s._d = true
741742
block = currentBlock
742743
closeBlock()

0 commit comments

Comments
 (0)