mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-02 16:19:08 +00:00
11 lines
309 B
TypeScript
11 lines
309 B
TypeScript
import UserContext from "@app/contexts/userContext";
|
|
import { useContext } from "react";
|
|
|
|
export function useUserContext() {
|
|
const context = useContext(UserContext);
|
|
if (context === undefined) {
|
|
throw new Error("useUserContext must be used within a UserProvider");
|
|
}
|
|
return context;
|
|
}
|