chore: warn NaN vnode key

This commit is contained in:
Evan You 2020-07-06 18:33:13 -04:00
parent d86b01ba3a
commit 31e37b417b

View File

@ -383,6 +383,11 @@ function _createVNode(
appContext: null appContext: null
} }
// validate key
if (__DEV__ && vnode.key !== vnode.key) {
warn(`VNode created with invalid key (NaN). VNode type:`, vnode.type)
}
normalizeChildren(vnode, children) normalizeChildren(vnode, children)
// presence of a patch flag indicates this node needs patching on updates. // presence of a patch flag indicates this node needs patching on updates.