Create virtual DOM nodes
h
uses the standard h(tag, attributes, children)
signature. Note that children
, if provided, is always an array to minimize type checks:
> h("div", { class: "foo" }, [ "hello world" ])
{
tag: "div",
attributes: { class: "foo" },
children: [ "hello world" ]
}
attributes
defaults to an empty object and thus can be omitted.
> h("h1", [ "title" ])
{
tag: "h1",
attributes: {},
children: [ "title" ]
}
The same principle applies to children
, except with an empty array.
> h("br")
{
tag: "br",
attributes: {},
children: []
}
semibran/manifest
- turn virtual DOM nodes into real DOM elements