14 lines
417 B
TypeScript
14 lines
417 B
TypeScript
import { createContext, useContext } from 'react';
|
|
|
|
export interface IndexPageContextValue {}
|
|
|
|
export const IndexPageContext = createContext<IndexPageContextValue | null>(null);
|
|
|
|
export function useIndexPageContext(): IndexPageContextValue {
|
|
const context = useContext(IndexPageContext);
|
|
if (!context) {
|
|
throw new Error('useIndexPageContext must be used within an IndexPageProvider');
|
|
}
|
|
return context;
|
|
}
|