@@ -595,20 +595,22 @@ export function createRenderer<
595
595
) {
596
596
for ( let i = 0 ; i < newChildren . length ; i ++ ) {
597
597
const oldVNode = oldChildren [ i ]
598
+ const newVNode = newChildren [ i ]
598
599
// Determine the container (parent element) for the patch.
599
- // - In the case of a Fragment, we need to provide the actual parent
600
- // of the Fragment itself so it can move its children.
601
- // - In the case of a Comment, this is likely a v-if toggle, which also
602
- // needs the correct parent container.
603
- // - In the case of a component, it could contain anything.
604
- // In other cases, the parent container is not actually used so we just
605
- // pass the block element here to avoid a DOM parentNode call.
606
600
const container =
601
+ // - In the case of a Fragment, we need to provide the actual parent
602
+ // of the Fragment itself so it can move its children.
607
603
oldVNode . type === Fragment ||
604
+ // - In the case of Comment nodes, this is likely a v-if toggle, which
605
+ // also needs the correct parent container.
608
606
oldVNode . type === Comment ||
607
+ newVNode . type === Comment ||
608
+ // - In the case of a component, it could contain anything.
609
609
oldVNode . shapeFlag & ShapeFlags . COMPONENT
610
610
? hostParentNode ( oldVNode . el ! ) !
611
- : fallbackContainer
611
+ : // In other cases, the parent container is not actually used so we
612
+ // just pass the block element here to avoid a DOM parentNode call.
613
+ fallbackContainer
612
614
patch (
613
615
oldVNode ,
614
616
newChildren [ i ] ,
0 commit comments