A virtual node which represents an HTML element.


User code will not typically create a VirtualElement node directly. Instead, the h() function will be used to create an element tree.

Hierarchy (view full)





The attributes for the element.

children: readonly VirtualNode[]

The children for the element.

renderer: undefined | VirtualElement.IRenderer

An 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.

tag: string

The tag name for the element.

type: "element" = ...

The type of the node.

This value can be used as a type guard for discriminating the VirtualNode union type.