mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
20 lines
545 B
TypeScript
20 lines
545 B
TypeScript
import type { AppRouter } from "../../server/src/routers";
|
|
import { QueryClient } from "@tanstack/react-query";
|
|
import { createTRPCClient, httpBatchLink } from "@trpc/client";
|
|
import { createTRPCOptionsProxy } from "@trpc/tanstack-react-query";
|
|
|
|
export const queryClient = new QueryClient();
|
|
|
|
const trpcClient = createTRPCClient<AppRouter>({
|
|
links: [
|
|
httpBatchLink({
|
|
url: `${process.env.EXPO_PUBLIC_SERVER_URL}/trpc`,
|
|
}),
|
|
],
|
|
});
|
|
|
|
export const trpc = createTRPCOptionsProxy<AppRouter>({
|
|
client: trpcClient,
|
|
queryClient,
|
|
});
|