preact
Version:
Tiny & fast Component-based virtual DOM framework.
15 lines (11 loc) • 360 B
JavaScript
/** Virtual DOM Node */
export function VNode(nodeName, attributes, children) {
/** @type {string|function} */
this.nodeName = nodeName;
/** @type {object<string>|undefined} */
this.attributes = attributes;
/** @type {array<VNode>|undefined} */
this.children = children;
/** Reference to the given key. */
this.key = attributes && attributes.key;
}