Skip to main content

Class: Context<T>

Defined in: src/sdk/components/FSComponent.ts:177

Provides a context of data that can be passed down to child components via a provider.

Type Parameters​

Type Parameter
T

Constructors​

Constructor​

new Context<T>(defaultValue): Context<T>

Defined in: src/sdk/components/FSComponent.ts:189

Creates an instance of a Context.

Parameters​

ParameterTypeDescription
defaultValueTThe default value of this context.

Returns​

Context<T>

Properties​

defaultValue​

readonly defaultValue: T

Defined in: src/sdk/components/FSComponent.ts:189

The default value of this context.

Methods​

Provider()​

readonly Provider(props): ContextProvider<T>

Defined in: src/sdk/components/FSComponent.ts:183

The provider component that can be set to a specific context value.

Parameters​

ParameterTypeDescription
propsContextProviderProps<T>The props of the provider component.

Returns​

ContextProvider<T>

A new context provider.