_root.tsx ``` export const Route = createRootRouteWithContext<{ queryClient: QueryClient; trpcClient: TRPCClient; trpc: TRPCClientOptionsProxy; authData: AuthData | undefined; authenticated: boolean; }>()({ beforeLoad: async () => { const authData = await getAuthData(); return { authData, authenticated: Boolean(authData), }; }, loader: async ({ context }) => { const { trpc, queryClient, authenticated } = context; if (authenticated) { await queryClient.ensureQueryData(trpc.currentUser.get.queryOptions()); } }, ``` Index route: ``` export const Route = createFileRoute("/_main/")({ component: Home, loader: async ({ context }) => { const { trpc, queryClient } = context; queryClient.prefetchQuery(upcomingMeetingsQueryOptions(trpc)); }, }); function Home() { return ( ); } ``` in the component tree: ``` function UpcomingMeetingList() { const trpc = useTRPC(); const { data: meetings } = useSuspenseQuery(upcomingMeetingsQueryOptions(trpc)); return ; } export function UpcomingMeetingSection() { return ( Upcoming Meetings Meetings happening now or starting soon }> {({ reset }) => ( ( Error loading meetings resetErrorBoundary()}>Try again )} > )} View full schedule ); } ```
Meetings happening now or starting soon
Error loading meetings