Construct a new virtual element node.
The element tag name.
The element attributes.
The element children.
Optional
renderer: VirtualElement.IRendererAn optional custom renderer for the element.
Readonly
attrsThe attributes for the element.
Readonly
childrenThe children for the element.
Readonly
rendererAn optional custom renderer for the element's children. If set, on render this element's DOM node and it's attrs will be created/updated as normal. At that point the DOM node is handed off to the renderer.
Readonly
tagThe tag name for the element.
Readonly
typeThe type of the node.
This value can be used as a type guard for discriminating the
VirtualNode
union type.
A virtual node which represents an HTML element.
Notes
User code will not typically create a
VirtualElement
node directly. Instead, theh()
function will be used to create an element tree.