Files
HKSingleParty/03_source/frontend/src/auth/hooks/use-auth-context.ts
louiscklaw b7cd25b614 build ok,
2025-06-15 11:28:24 +08:00

15 lines
356 B
TypeScript

import { use } from 'react';
import { AuthContext } from '../context/auth-context';
// ----------------------------------------------------------------------
export function useAuthContext() {
const context = use(AuthContext);
if (!context) {
throw new Error('useAuthContext: Context must be used inside AuthProvider');
}
return context;
}