Skip to main content
Version: 10.x

withTRPC()

Signature

ts
withTRPC<TRouter, TSSRContext>(opts: WithTRPCNoSSROptions<TRouter> | WithTRPCSSROptions<TRouter>): Function;
ts
withTRPC<TRouter, TSSRContext>(opts: WithTRPCNoSSROptions<TRouter> | WithTRPCSSROptions<TRouter>): Function;

Type parameters

  • TRouter extends Router<AnyRouterDef<AnyRootConfig, any>, TRouter>
  • TSSRContext extends NextPageContext = NextPageContext

Parameters

NameType
optsWithTRPCNoSSROptions<TRouter> | WithTRPCSSROptions<TRouter>

Returns

Function

Signature

ts
(AppOrPage: NextComponentType<any, any, any>): NextComponentType<NextPageContext, {}, {}>;
ts
(AppOrPage: NextComponentType<any, any, any>): NextComponentType<NextPageContext, {}, {}>;

Parameters

NameType
AppOrPageNextComponentType<any, any, any>

Returns

NextComponentType<NextPageContext, {}, {}>

Defined in: next/src/withTRPC.tsx:82