mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
feat(cli): optimize oRPC client dependencies by removing server dependency (#515)
Co-authored-by: Aman Varshney <amanvarshney.work@gmail.com>
This commit is contained in:
@@ -7,9 +7,8 @@ import { link, orpc } from "@/utils/orpc";
|
||||
import type { QueryClient } from "@tanstack/react-query";
|
||||
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
||||
import { useState } from "react";
|
||||
import type { RouterClient } from "@orpc/server";
|
||||
import { createTanstackQueryUtils } from "@orpc/tanstack-query";
|
||||
import type { appRouter } from "../../../server/src/routers";
|
||||
import type { AppRouterClient } from "../../../server/src/routers";
|
||||
import { createORPCClient } from "@orpc/client";
|
||||
{{/if}}
|
||||
{{#if (eq api "trpc")}}
|
||||
@@ -67,7 +66,7 @@ function RootComponent() {
|
||||
});
|
||||
|
||||
{{#if (eq api "orpc")}}
|
||||
const [client] = useState<RouterClient<typeof appRouter>>(() => createORPCClient(link));
|
||||
const [client] = useState<AppRouterClient>(() => createORPCClient(link));
|
||||
const [orpcUtils] = useState(() => createTanstackQueryUtils(client));
|
||||
{{/if}}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user