quivr/frontend/lib/context/ChatsProvider/hooks/useChatsContext.tsx
2023-07-03 18:38:12 +02:00

15 lines
322 B
TypeScript

/* eslint-disable */
import { useContext } from "react";
import { ChatsContext } from "../chats-provider";
export const useChatsContext = () => {
const context = useContext(ChatsContext);
if (context === undefined) {
throw new Error("useChatsStore must be used inside ChatsProvider");
}
return context;
};