]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(hmr): static child traversal should only affect elements
authorEvan You <yyx990803@gmail.com>
Mon, 11 May 2020 19:46:30 +0000 (15:46 -0400)
committerEvan You <yyx990803@gmail.com>
Mon, 11 May 2020 19:46:30 +0000 (15:46 -0400)
packages/runtime-core/src/renderer.ts

index 359648b531220d7b0e01bb992b0a9abf50497110..3050f401b5668645a44bcd2873ce7a9a72b2bf66 100644 (file)
@@ -1984,7 +1984,12 @@ function baseCreateRenderer(
       for (let i = 0; i < ch1.length; i++) {
         const c1 = ch1[i]
         const c2 = ch2[i]
-        if (isVNode(c1) && isVNode(c2) && !c2.dynamicChildren) {
+        if (
+          isVNode(c1) &&
+          isVNode(c2) &&
+          c2.shapeFlag & ShapeFlags.ELEMENT &&
+          !c2.dynamicChildren
+        ) {
           if (c2.patchFlag <= 0) {
             c2.el = c1.el
           }