Skip to content
Source
Sign inSign up

composerHandleContext.ts

10 lines391 Bytes

1import { createContext, use } from "react";
2import type { ChatComposerHandle } from "./components/chat/ChatComposer";
3​
4export type ComposerHandleRef = React.RefObject<ChatComposerHandle | null>;
5​
6export const ComposerHandleContext = createContext<ComposerHandleRef | null>(null);
7​
8export function useComposerHandleContext(): ComposerHandleRef | null {
9 return use(ComposerHandleContext);