Files
hipmi-mobile/hook/use-auth.ts
Bagasbanuna02 e1039a5744 Add:
- context/
- hook/
- types/

### No Issue
2025-08-19 15:25:07 +08:00

11 lines
275 B
TypeScript

import { AuthContext } from "@/context/AuthContext";
import { useContext } from "react";
export const useAuth = () => {
const context = useContext(AuthContext);
if (!context) {
throw new Error("useAuth must be used within an AuthProvider");
}
return context;
};