Skip to content

Commit

Permalink
render supports a third argument that allows a functional component t…
Browse files Browse the repository at this point in the history
…o control the main contender
  • Loading branch information
UpperCod committed Feb 11, 2019
1 parent 629bb93 commit 334df5f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ export function h(tag, props, ...children) {
return vnode(tag, props, children);
}

export function render(vnode, node) {
export function render(vnode, node, hostComponent) {
update(
node,
typeof vnode === "object" && vnode.tag === "host"
hostComponent
? vnode
: typeof vnode === "object" && vnode.tag === "host"
? vnode
: h("host", {}, vnode)
);
Expand Down

0 comments on commit 334df5f

Please sign in to comment.