import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { httpBatchLink } from "@trpc/client"; import React, { useState } from "react"; import { trpc } from "./trpc"; export function App() { const [queryClient] = useState(() => new QueryClient()); const [trpcClient] = useState(() => trpc.createClient({ links: [ httpBatchLink({ url: "http://localhost:3000/trpc", // You can pass any HTTP headers you wish here async headers() { return { // authorization: getAuthCookie(), }; }, }), ], }), ); return ( {/* Your app here */} ); }