Skip to main content
Version: 11.x

Function: createServerSideHelpers()

createServerSideHelpers<TRouter>(opts): ProtectedIntersection<object, DecoratedProcedureSSGRecord<TRouter["_def"]["_config"]["$types"], TRouter["_def"]["record"]>>

Create functions you can use for server-side rendering / static generation

Type Parameters

Type Parameter
TRouter extends AnyRouter

Parameters

ParameterType
optsCreateServerSideHelpersOptions<TRouter>

Returns

ProtectedIntersection<object, DecoratedProcedureSSGRecord<TRouter["_def"]["_config"]["$types"], TRouter["_def"]["record"]>>

dehydrate()

dehydrate: (opts?) => DehydratedState

Parameters

ParameterType
opts?DehydrateOptions

Returns

DehydratedState

queryClient

queryClient: QueryClient

See

https://trpc.io/docs/v11/client/nextjs/server-side-helpers

Defined in

packages/react-query/src/server/ssgProxy.ts:82