Skip to main content

Class: DisplayComponent<P, Contexts>

A display component in the component framework.

Type parameters

NameType
PP
Contextsextends unknown[] = []

Hierarchy

Constructors

constructor

new DisplayComponent<P, Contexts>(props): DisplayComponent<P, Contexts>

Creates an instance of a DisplayComponent.

Type parameters

NameType
PP
Contextsextends unknown[] = []

Parameters

NameTypeDescription
propsPThe propertis of the component.

Returns

DisplayComponent<P, Contexts>

Defined in

src/sdk/components/FSComponent.ts:73

Properties

context

Optional context: [...ContextSubcriptions<Contexts>[]] = undefined

The context on this component, if any.

Defined in

src/sdk/components/FSComponent.ts:64


contextType

Optional Readonly contextType: readonly [ContextTypes<Contexts>] = undefined

The type of context for this component, if any.

Defined in

src/sdk/components/FSComponent.ts:67


props

props: P & ComponentProps

The properties of the component.

Defined in

src/sdk/components/FSComponent.ts:61

Methods

destroy

destroy(): void

Destroys this component.

Returns

void

Defined in

src/sdk/components/FSComponent.ts:98


getContext

getContext(context): ContextSubcriptions<Contexts>[number]

Gets a context data subscription from the context collection.

Parameters

NameTypeDescription
contextContextTypes<Contexts>[number]The context to get the subscription for.

Returns

ContextSubcriptions<Contexts>[number]

The requested context.

Throws

An error if no data for the specified context type could be found.

Defined in

src/sdk/components/FSComponent.ts:106


onAfterRender

onAfterRender(node): void

A callback that is called after the component is rendered.

Parameters

NameTypeDescription
nodeVNodeThe component's VNode.

Returns

void

Defined in

src/sdk/components/FSComponent.ts:87


onBeforeRender

onBeforeRender(): void

A callback that is called before the component is rendered.

Returns

void

Defined in

src/sdk/components/FSComponent.ts:80


render

render(): null | VNode

Renders the component.

Returns

null | VNode

A JSX element to be rendered.

Defined in

src/sdk/components/FSComponent.ts:93