Skip to content
This repository was archived by the owner on Dec 16, 2021. It is now read-only.

Commit 6567dc1

Browse files
authored
Performance tweak: don't clone empty attributes (#434)
1 parent 998c20a commit 6567dc1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ options.vnode = vnode => {
7272
vnode.preactCompatUpgraded = true;
7373

7474
let tag = vnode.nodeName,
75-
attrs = vnode.attributes = extend({}, vnode.attributes);
75+
attrs = vnode.attributes = vnode.attributes==null ? {} : extend({}, vnode.attributes);
7676

7777
if (typeof tag==='function') {
7878
if (tag[COMPONENT_WRAPPER_KEY]===true || (tag.prototype && 'isReactComponent' in tag.prototype)) {

0 commit comments

Comments
 (0)