@@ -595,20 +595,22 @@ export function createRenderer<
595595 ) {
596596 for ( let i = 0 ; i < newChildren . length ; i ++ ) {
597597 const oldVNode = oldChildren [ i ]
598+ const newVNode = newChildren [ i ]
598599 // 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.
606600 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.
607603 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.
608606 oldVNode . type === Comment ||
607+ newVNode . type === Comment ||
608+ // - In the case of a component, it could contain anything.
609609 oldVNode . shapeFlag & ShapeFlags . COMPONENT
610610 ? 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
612614 patch (
613615 oldVNode ,
614616 newChildren [ i ] ,
0 commit comments