Don't pass context attrs to HTML elements

This commit is contained in:
Zaid Abdulla committed 2019-07-08 17:53:06 -07:00
1 parent 49b5e582cc
commit 795a0f8273
1 file changed
+4 -2
+4 -2
View File
@@ -110,8 +110,10 @@ function applyContext(vnode, parentContext): void {
for (const c of vnode) applyContext(c, parentContext);
} else if (vnode && typeof vnode === "object" && vnode.tag) {
const vc = Object.assign({}, parentContext, vnodeContext.get(vnode));
vnodeContext.set(vnode, vc);
vnode.attrs = Object.assign({}, vc, vnode.attrs);
if (typeof vnode.tag !== "string") {
vnodeContext.set(vnode, vc);
vnode.attrs = Object.assign({}, vc, vnode.attrs);
}
if (vnode.children && vnode.children.length)
for (const c of vnode.children) applyContext(c, vc);
}