(matches?: UIMatch[])
| 5 | import { useTypedMatchesData } from "./useTypedMatchData"; |
| 6 | |
| 7 | export 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 | |
| 16 | export function useUser(matches?: UIMatch[]): User { |
| 17 | const maybeUser = useOptionalUser(matches); |
no test coverage detected
searching dependent graphs…