FluidContext Interface

Packages > @fluidframework/react > FluidContext

The returned value of createFluidContext

Signature:

export interface FluidContext<SV extends IViewState, C> 

Properties

List of properties of this interface
Property Type Description
Consumer React.Consumer<FluidContextState> The context consumer that allows children to use the FluidContextState
Provider React.ProviderExoticComponentFluidContextState>> The context provider React component that will give the FluidContextState to its children
setState (newState: SV) => void Callback to update the state
state SV The view state
usePrimedContext () => FluidContextState Callback to get the context

Events

Consumer

The context consumer that allows children to use the FluidContextState

Signature:

Consumer: React.Consumer<FluidContextState<SV, C>>;

Provider

The context provider React component that will give the FluidContextState to its children

Signature:

Provider: React.ProviderExoticComponent<React.ProviderProps<FluidContextState<SV, C>>>;

setState

Callback to update the state

Signature:

setState: (newState: SV) => void;

state

The view state

Signature:

state: SV;

usePrimedContext

Callback to get the context

Signature:

usePrimedContext: () => FluidContextState<SV, C>;