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