createProvider
Callable
Type parameters
- T
Parameters
displayName: string
The name of the context. Used for error messages.
defaultValue: null | T = null
The default value of the context.
Returns readonly [hook: () => T, provider: React.Provider<T | null>, consumer: React.Consumer<T | null>]
A tuple of the hook, provider, and consumer.
Creates a context provider, hook, and consumer.