fosrl.pangolin/src/hooks/useOrgUserContext.ts
2024-11-10 21:19:41 -05:00

12 lines
350 B
TypeScript

import OrgUserContext from "@app/contexts/orgUserContext";
import { useContext } from "react";
export function userOrgUserContext() {
const context = useContext(OrgUserContext);
if (context === undefined) {
throw new Error(
"useOrgUserContext must be used within a OrgUserProvider"
);
}
return context;
}