From: Evan You Date: Mon, 6 Jul 2020 22:33:13 +0000 (-0400) Subject: chore: warn NaN vnode key X-Git-Tag: v3.0.0-beta.19~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31e37b417b4371250a54045a2c03e2520f92cad6;p=thirdparty%2Fvuejs%2Fcore.git chore: warn NaN vnode key --- diff --git a/packages/runtime-core/src/vnode.ts b/packages/runtime-core/src/vnode.ts index f5ff1cdc36..943d43ab37 100644 --- a/packages/runtime-core/src/vnode.ts +++ b/packages/runtime-core/src/vnode.ts @@ -383,6 +383,11 @@ function _createVNode( appContext: null } + // validate key + if (__DEV__ && vnode.key !== vnode.key) { + warn(`VNode created with invalid key (NaN). VNode type:`, vnode.type) + } + normalizeChildren(vnode, children) // presence of a patch flag indicates this node needs patching on updates.