Skip to main content

StatefullComponent()<S>

StatefullComponent<S>: (state, update) => TemplateResult

Represents a function that returns a TemplateResult for a stateful component.

Type parameters

Type parameterValueDescription
S extends Record<string, any>Record<string, any>The type of the component state.

Parameters

ParameterTypeDescription
stateSThe current state of the component.
updateUpdateFunction<S>An update function you can call inside the template.
WARNING! It can cause infinite loops if not used properly.

Returns

TemplateResult