suspense-service

suspense-service / Exports / useStateContext

Function: useStateContext

useStateContext<T>(context: StateContext<T>, id?: Id): State<T>

Consumes a stateful value from a StateContextProvider, and a function to update it

Type parameters:

Name
T

Parameters:

Name Type Description
context StateContext<T> the StateContext to use
id? Id the StateContextProvider id to use

Returns: State<T>

Defined in: StateContext/index.ts:47