Called when the underlying DOM of this component is removed (or replaced). Intended for cleanup tasks.
Returns the hdom tree of this component. Note: Always will be called first (prior to init
/release
) to obtain the actual component definition used for diffing. Therefore might have to include checks if any local state has already been initialized via init
. This is the only mandatory method which MUST be implemented.
render
is executed before init
because normalizeTree()
must obtain the component's hdom tree first before it can determine if an init
is necessary. init
itself will be called from diffTree
, createDOM
or hydrateDOM()
in a later phase of processing.
render
should ALWAYS return an array or another function, else the component's init
or release
fns will NOT be able to be called later. E.g. If the return value of render
evaluates as a string or number, the return value should be wrapped as ["span", "foo"]
. If no init
or release
are used, this requirement is relaxed.
Generated using TypeDoc
Component init method. Called with the actual DOM element, hdom user context and any other args when the component is first used, but after
render()
has been called once already AND all of the components children have been realized. Therefore, if any children have their owninit
lifecycle method, these hooks will be executed before that of the parent.