plane/web/contexts/app-root/use-app-root.tsx
2023-12-13 02:03:29 +05:30

9 lines
302 B
TypeScript

import { useContext } from "react";
import { AppRootStoreContext } from "./app-root-provider";
export const useAppRoot = () => {
const context = useContext(AppRootStoreContext);
if (context === undefined) throw new Error("useAppRoot must be used within AppRootStoreContext");
return context;
};