Skip to main content

Class: Context<T>

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

Type parameters

Name
T

Constructors

constructor

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

Creates an instance of a Context.

Type parameters

Name
T

Parameters

NameTypeDescription
defaultValueTThe default value of this context.

Returns

Context<T>

Defined in

src/sdk/components/FSComponent.ts:189

Properties

defaultValue

Readonly defaultValue: T

The default value of this context.

Defined in

src/sdk/components/FSComponent.ts:189

Methods

Provider

Provider(props): ContextProvider<T>

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

Parameters

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

Returns

ContextProvider<T>

A new context provider.

Defined in

src/sdk/components/FSComponent.ts:183