mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-03 00:29:10 +00:00
13 lines
343 B
TypeScript
13 lines
343 B
TypeScript
import DomainContext from "@app/contexts/domainContext";
|
|
import { useContext } from "react";
|
|
|
|
export function useDomainContext() {
|
|
const context = useContext(DomainContext);
|
|
if (context === undefined) {
|
|
throw new Error(
|
|
"useDomainContext must be used within a DomainProvider"
|
|
);
|
|
}
|
|
return context;
|
|
}
|