Files
trackgo-fe/packages/ui/src/foundations/enterprise-module/hooks/use-index-page.context.ts
T

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;
}