Explorar o código

fix: vnode key ref should default to null

Evan You %!s(int64=7) %!d(string=hai) anos
pai
achega
693938d956
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      packages/runtime-core/src/vnode.ts

+ 2 - 2
packages/runtime-core/src/vnode.ts

@@ -119,8 +119,8 @@ export function createVNode(
   const vnode: VNode = {
     type,
     props,
-    key: props && props.key,
-    ref: props && props.ref,
+    key: (props && props.key) || null,
+    ref: (props && props.ref) || null,
     children: null,
     component: null,
     el: null,