# Type Alias: LocalLinkOptions<TRouter>

> 

> **LocalLinkOptions**\<`TRouter`\>: `object` & `TransformerOptions`\<`inferClientTypes`\<`TRouter`\>\>

Defined in: packages/client/dist/index.d.mts:356

Options for [localLink](https://trpc.io/docs/typedoc/react-query/index/functions/localLink.md).

## Type declaration

### createContext()

> **createContext**: () => `Promise`\<`inferRouterContext`\<`TRouter`\>\>

Creates the context for each call.

#### Returns

`Promise`\<`inferRouterContext`\<`TRouter`\>\>

#### See

https://trpc.io/docs/client/links/localLink#createcontext

### onError()?

> `optional` **onError**: (`opts`) => `void`

Called when a procedure throws.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `opts` | `ErrorHandlerOptions`\<`inferRouterContext`\<`TRouter`\>\> |

#### Returns

`void`

#### See

https://trpc.io/docs/client/links/localLink#onerror

### router

> **router**: `TRouter`

The router to call.

#### See

https://trpc.io/docs/client/links/localLink#router

## Type Parameters

| Type Parameter |
| ------ |
| `TRouter` *extends* `AnyRouter` |

## See

https://trpc.io/docs/client/links/localLink#options
