Function: createTRPCOptionsProxy()
On this page
createTRPCOptionsProxy<
TRouter,TFeatureFlags,TLinkContext>(opts):TRPCOptionsProxy<TRouter,TFeatureFlags,TLinkContext>
Defined in: createOptionsProxy.ts:426
Creates the options proxy without React context. Works on the server too.
The router's type, and the context the client's links read, come from
client.
Type Parameters
| Type Parameter | Default type |
|---|---|
TRouter extends AnyRouter | - |
TFeatureFlags extends FeatureFlags | object |
TLinkContext extends object | Record<string, unknown> |
Parameters
| Parameter | Type |
|---|---|
opts | TRPCOptionsProxyOptions<TRouter, TFeatureFlags, TLinkContext> |
Returns
TRPCOptionsProxy<TRouter, TFeatureFlags, TLinkContext>
Example
export const trpc = createTRPCOptionsProxy({
client: trpcClient,
queryClient,
});