mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-01 15:49:08 +00:00
13 lines
355 B
TypeScript
13 lines
355 B
TypeScript
import ResourceContext from "@app/contexts/resourceContext";
|
|
import { useContext } from "react";
|
|
|
|
export function useResourceContext() {
|
|
const context = useContext(ResourceContext);
|
|
if (context === undefined) {
|
|
throw new Error(
|
|
"useResourceContext must be used within a ResourceProvider"
|
|
);
|
|
}
|
|
return context;
|
|
}
|