Przeglądaj źródła

fix(runtime-core): fix dev fragment root flag check

Evan You 5 lat temu
rodzic
commit
9cf75258c8
1 zmienionych plików z 5 dodań i 1 usunięć
  1. 5 1
      packages/runtime-core/src/renderer.ts

+ 5 - 1
packages/runtime-core/src/renderer.ts

@@ -848,7 +848,11 @@ function baseCreateRenderer(
     }
     if (parentComponent) {
       let subTree = parentComponent.subTree
-      if (__DEV__ && subTree.patchFlag & PatchFlags.DEV_ROOT_FRAGMENT) {
+      if (
+        __DEV__ &&
+        subTree.patchFlag > 0 &&
+        subTree.patchFlag & PatchFlags.DEV_ROOT_FRAGMENT
+      ) {
         subTree =
           filterSingleRoot(subTree.children as VNodeArrayChildren) || subTree
       }