// This is not forwarding the client headers.export const trpc = createTRPCProxyClient<IAppRouter>({ links: [ httpBatchLink({ url: `${getBaseUrl()}/api/trpc`, headers() { // how to forward client headers? const heads = new Map(); // <-- specifically this part return Object.fromEntries(heads); }, }), ],});
trpc
export const routeData = () => { return createServerData$(async () => { const organizations = await trpc.organization.getOrganizationsByUser.query(); return organizations; });};const Page: VoidComponent = () => { const organizations = useRouteData<typeof routeData>(); return ( <div> Organizations </div> );};export default Page;