mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-19 03:16:40 +00:00
Create resource working
This commit is contained in:
10
src/hooks/useResourceContext.ts
Normal file
10
src/hooks/useResourceContext.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user