Skip to content

Commit aec2338

Browse files
committed
fix(runtime-core): normalize empty extra props to null for cloneVnode
fix vuejs#1704
1 parent d452723 commit aec2338

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/runtime-core/src/vnode.ts

+3
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,9 @@ export function cloneVNode<T, U>(
427427
vnode: VNode<T, U>,
428428
extraProps?: Data & VNodeProps | null
429429
): VNode<T, U> {
430+
if (extraProps && Object.keys(extraProps).length === 0) {
431+
extraProps = null
432+
}
430433
// This is intentionally NOT using spread or extend to avoid the runtime
431434
// key enumeration cost.
432435
const { props, patchFlag } = vnode

0 commit comments

Comments
 (0)