Function: createContext()
Call Signature
function createContext<T>(): Context<T | undefined>;
Creates a new context with no default value, thus making its default value undefined.
Type Parameters
| Type Parameter | Description |
|---|---|
T | Context value type. |
Returns
Context<T | undefined>
Call Signature
function createContext<T>(defaultValue): Context<T>;
Creates a new context with a default value.
Type Parameters
| Type Parameter | Description |
|---|---|
T | Context value type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
defaultValue | T | - |
Returns
Context<T>