Explorar el Código

fix(runtime-vapor): add a non-null check for parentComponent (#14666)

Jack hace 1 mes
padre
commit
789b7f2329
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      packages/runtime-vapor/src/vdomInterop.ts

+ 2 - 1
packages/runtime-vapor/src/vdomInterop.ts

@@ -188,7 +188,8 @@ const vaporInteropImpl: Omit<
     ensureVNodeHookState(instance, vnode)
 
     // copy the shape flag from the vdom component if inside a keep-alive
-    if (isKeepAlive(parentComponent)) instance.shapeFlag = vnode.shapeFlag
+    if (parentComponent && isKeepAlive(parentComponent))
+      instance.shapeFlag = vnode.shapeFlag
 
     if (vnode.transition) {
       setVaporTransitionHooks(