Files
AIRegulation-DocAnalysis/frontend/src/contexts/useApp.ts

12 lines
298 B
TypeScript
Raw Normal View History

import { useContext } from 'react';
import { AppContext, type AppContextValue } from './app-context';
export function useApp(): AppContextValue {
const context = useContext(AppContext);
if (!context) {
throw new Error('useApp must be used within an AppProvider');
}
return context;
}