MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / useOptionalUser

Function useOptionalUser

apps/webapp/app/hooks/useUser.ts:7–14  ·  view source on GitHub ↗
(matches?: UIMatch[])

Source from the content-addressed store, hash-verified

5import { useTypedMatchesData } from "./useTypedMatchData";
6
7export function useOptionalUser(matches?: UIMatch[]): User | undefined {
8 const routeMatch = useTypedMatchesData<typeof loader>({
9 id: "root",
10 matches,
11 });
12
13 return routeMatch?.user ?? undefined;
14}
15
16export function useUser(matches?: UIMatch[]): User {
17 const maybeUser = useOptionalUser(matches);

Callers 4

UserProfilePhotoFunction · 0.90
usePostHogFunction · 0.90
useUserFunction · 0.85
useHasAdminAccessFunction · 0.85

Calls 1

useTypedMatchesDataFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…