Skip to content

Generic Component Lifecycle API

Methods

NameRegionArgumentsReturns
loadClientPromise<void>
unloadClientPromise<void>
mountClientcontainer (HTMLElement), props (1), locals (2)void
unmountClientcontainer (HTMLElement), locals (2)void
updateClientprops (1), locals (2)void
bootstrapServerPromise<void>
stringifyServerprops (1)Promise<string>

INFO

Hydration scenarios are covered via mount by looking either into container (would be non-empty in a hydration scenario) or into locals (which would contain a truthy value for hydrate, i.e., !!locals.hydrate would be true).

(1) the props are the deserialized object from the data property

(2) the locals is an (initially) empty object that can be used at will to transport information between the different lifecycle methods; it is created per component instance

Released under the MIT License.