MCPcopy
hub / github.com/devias-io/material-kit-react / useUser

Function useUser

src/hooks/use-user.ts:6–14  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4import { UserContext } from '@/contexts/user-context';
5
6export function useUser(): UserContextValue {
7 const context = React.useContext(UserContext);
8
9 if (!context) {
10 throw new Error('useUser must be used within a UserProvider');
11 }
12
13 return context;
14}

Callers 5

AuthGuardFunction · 0.90
GuestGuardFunction · 0.90
SignInFormFunction · 0.90
SignUpFormFunction · 0.90
UserPopoverFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected