10 lines
No EOL
316 B
TypeScript
10 lines
No EOL
316 B
TypeScript
import ClientContext from "@app/contexts/clientContext";
|
|
import { useContext } from "react";
|
|
|
|
export function useClientContext() {
|
|
const context = useContext(ClientContext);
|
|
if (context === undefined) {
|
|
throw new Error('useSiteContext must be used within a SiteProvider');
|
|
}
|
|
return context;
|
|
} |