class Element

Element instances define trees of Components and/or DOM nodes that are created when a Component instance is rendered. Elements should never be created explicitly with the new operator, but rather the function e() should be used. Further, client code should never attempt to mutate an Element instance once it is created.

Constructor

constructor(type, ctorProps, ppProps, children)

type [subclass of Component | string]

ctorProps [Object]

ppProps [Object]

children [optional, Element | Array of Element | falsey]

Initializes instance properties as given by constructor arguments. If children is falsey, then the children property is not defined.

Public Properties

type [subclass of Component | string]

If a string, then must be a legal tag name that can be applied to document.createElement(). Note that Component is a legal subclass of Component.

ctorProps [Object]

If type is a subclass of Component, then ctorProps are passed as kwargs when the Component is instantiated. If type is a DOM tag name, then ctorProps gives the set of property/attributes to initialize on the node after it is created.

ppProps [Object]

The list of post-processing instructions to apply after the Component instance or DOM node is created. See e().

children [Element | Array of Element | null]

This set of children of the Component instance or DOM node given by type.