Skip to content

Commit c59897c

Browse files
authored
fix(runtime-core): skip patchBlockChildren if n1.dynamicChildren is null (#2717)
fix #2715 The bug was introduced by #2485 where a compiled slot may result in a bailed Fragment which then gets its dynamicChildren set to `null` by the renderer.
1 parent a835250 commit c59897c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/runtime-core/src/renderer.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1139,12 +1139,15 @@ function baseCreateRenderer(
11391139
if (
11401140
patchFlag > 0 &&
11411141
patchFlag & PatchFlags.STABLE_FRAGMENT &&
1142-
dynamicChildren
1142+
dynamicChildren &&
1143+
// #2715 the previous fragment could've been a BAILed one as a result
1144+
// of renderSlot() with no valid children
1145+
n1.dynamicChildren
11431146
) {
11441147
// a stable fragment (template root or <template v-for>) doesn't need to
11451148
// patch children order, but it may contain dynamicChildren.
11461149
patchBlockChildren(
1147-
n1.dynamicChildren!,
1150+
n1.dynamicChildren,
11481151
dynamicChildren,
11491152
container,
11501153
parentComponent,

0 commit comments

Comments
 (0)