Skip to content

Commit

Permalink
fix(runtime-core): normalize empty extra props to null for cloneVnode
Browse files Browse the repository at this point in the history
  • Loading branch information
underfin committed Jul 28, 2020
1 parent d452723 commit aec2338
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/runtime-core/src/vnode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,9 @@ export function cloneVNode<T, U>(
vnode: VNode<T, U>,
extraProps?: Data & VNodeProps | null
): VNode<T, U> {
if (extraProps && Object.keys(extraProps).length === 0) {
extraProps = null
}
// This is intentionally NOT using spread or extend to avoid the runtime
// key enumeration cost.
const { props, patchFlag } = vnode
Expand Down

0 comments on commit aec2338

Please sign in to comment.