# Function: ~~createTRPCReact()~~

> 

> **createTRPCReact**\<`TRouter`, `TSSRContext`\>(`opts`?): `ProtectedIntersection`\<`CreateTRPCReactBase`\<`TRouter`, `TSSRContext`\>, `DecorateRouterRecord`\<`TRouter`\[`"_def"`\]\[`"_config"`\]\[`"$types"`\], `TRouter`\[`"_def"`\]\[`"record"`\]\>\>

Defined in: [packages/react-query/src/createTRPCReact.tsx:541](https://github.com/trpc/trpc/blob/7c907acfd8b31929214792e3b8c2ad7a8ac72563/packages/react-query/src/createTRPCReact.tsx#L541)

Creates typed React hooks for your router, built on TanStack React Query.

## Type Parameters

| Type Parameter | Default type |
| ------ | ------ |
| `TRouter` *extends* `AnyRouter` | - |
| `TSSRContext` | `unknown` |

## Parameters

| Parameter | Type |
| ------ | ------ |
| `opts`? | `CreateTRPCReactOptions`\<`TRouter`\> |

## Returns

`ProtectedIntersection`\<`CreateTRPCReactBase`\<`TRouter`, `TSSRContext`\>, `DecorateRouterRecord`\<`TRouter`\[`"_def"`\]\[`"_config"`\]\[`"$types"`\], `TRouter`\[`"_def"`\]\[`"record"`\]\>\>

## Example

```ts
export const trpc = createTRPCReact<AppRouter>();
```

## Deprecated

`@trpc/react-query` only gets bug fixes and will be removed in
the next major version. Use `@trpc/tanstack-react-query` instead.

## See

 - https://trpc.io/docs/client/tanstack-react-query/migrating
 - https://trpc.io/docs/client/react/setup
