mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-07 11:24:42 +02:00
12 lines
350 B
TypeScript
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;
|
|
}
|