@assistant-ui/react
Version:
Open-source TypeScript/React library for building production-grade AI chat experiences
11 lines • 484 B
TypeScript
import { type Context } from "react";
/**
* Creates a context hook with optional support.
* @param context - The React context to consume.
* @param providerName - The name of the provider for error messages.
* @returns A hook function that provides the context value.
*/
export declare function createContextHook<T>(context: Context<T | null>, providerName: string): (options?: {
optional?: boolean | undefined;
}) => T | null;
//# sourceMappingURL=createContextHook.d.ts.map