createContext API
API reference for the createContext composable.
Related
Explore these related pages for additional context and usage patterns.
| Page | Category |
|---|---|
| createContext | Foundation |
| createTrinity | Foundation |
| createPlugin | Foundation |
| Core | Fundamentals |
Functions
useContext
(key: ContextKey<Z>, defaultValue?: Z | undefined) => ZInjects a context provided by an ancestor component.
provideContext
(key: ContextKey<Z>, context: Z, app?: App<any> | undefined) => ZProvides a context to all descendant components.
createContext
(keyOrOptions?: ContextKey<Z> | CreateContextOptions | undefined, defaultValue?: Z | undefined) => readonly [() => Z, (context: Z, app?: App) => Z] | readonly [(key: string, defaultValue?: Z) => Z, (key: string, context: Z, app?: App) => Z]