plane/web/contexts/page.context/use-page.tsx

9 lines
279 B
TypeScript
Raw Normal View History

2023-12-12 20:33:29 +00:00
import { useContext } from "react";
import { PageContext } from "./page-provider";
export const usePage = () => {
const context = useContext(PageContext);
if (context === undefined) throw new Error("useAppRoot must be used within AppRootStoreContext");
return context;
};