Skip to content

Commit 7d436ab

Browse files
committed
fix: mounting new children
1 parent 2fdb499 commit 7d436ab

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

packages/runtime-core/src/renderer.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -1310,13 +1310,12 @@ export function createRenderer<
13101310
const nextPos = e2 + 1
13111311
const anchor =
13121312
nextPos < l2 ? (c2[nextPos] as HostVNode).el : parentAnchor
1313-
const n2 = (c2[i] = optimized
1314-
? cloneIfMounted(c2[i] as HostVNode)
1315-
: normalizeVNode(c2[i]))
13161313
while (i <= e2) {
13171314
patch(
13181315
null,
1319-
n2,
1316+
(c2[i] = optimized
1317+
? cloneIfMounted(c2[i] as HostVNode)
1318+
: normalizeVNode(c2[i])),
13201319
container,
13211320
anchor,
13221321
parentComponent,

packages/runtime-core/src/vnode.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ export function normalizeVNode<T, U>(child: VNodeChild<T, U>): VNode<T, U> {
355355

356356
// optimized normalization for template-compiled render fns
357357
export function cloneIfMounted(child: VNode): VNode {
358-
return child.el == null ? child : cloneVNode(child)
358+
return child.el === null ? child : cloneVNode(child)
359359
}
360360

361361
export function normalizeChildren(vnode: VNode, children: unknown) {

0 commit comments

Comments
 (0)