mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-02 08:09:10 +00:00
Fix naming and add update to site provider?
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import { SiteContext } from "@app/contexts/siteContext";
|
||||
import SiteContext from "@app/contexts/siteContext";
|
||||
import { useContext } from "react";
|
||||
|
||||
export function useSiteContext() {
|
||||
const site = useContext(SiteContext);
|
||||
return site;
|
||||
}
|
||||
const context = useContext(SiteContext);
|
||||
if (context === undefined) {
|
||||
throw new Error('useSiteContext must be used within a SiteProvider');
|
||||
}
|
||||
return context;
|
||||
}
|
||||
Reference in New Issue
Block a user