diff --git a/src/trpc/react.tsx b/src/trpc/react.tsx index cc5c41f..dabe85a 100644 --- a/src/trpc/react.tsx +++ b/src/trpc/react.tsx @@ -1,7 +1,7 @@ 'use client' import { type QueryClient, QueryClientProvider } from '@tanstack/react-query' -import { httpBatchStreamLink, loggerLink } from '@trpc/client' +import { httpBatchLink, httpBatchStreamLink, loggerLink } from '@trpc/client' import { createTRPCReact } from '@trpc/react-query' import type { inferRouterInputs, inferRouterOutputs } from '@trpc/server' import { useState } from 'react' @@ -49,7 +49,7 @@ export function TRPCReactProvider(props: { children: React.ReactNode }) { process.env.NODE_ENV === 'development' || (op.direction === 'down' && op.result instanceof Error), }), - httpBatchStreamLink({ + httpBatchLink({ transformer: SuperJSON, url: `${getBaseUrl()}/api/trpc`, headers: () => { @@ -57,12 +57,6 @@ export function TRPCReactProvider(props: { children: React.ReactNode }) { headers.set('x-trpc-source', 'nextjs-react') return headers }, - fetch: (url, options) => { - return fetch(url, { - ...options, - keepalive: true, - }) - }, }), ], })