---
url: https://lit-ui-router.dev/api/reference/types/TypedLitViewComponent.md
---
[lit-ui-router](../index.md) / TypedLitViewComponent

# Type Alias: TypedLitViewComponent\<T>

```ts
type TypedLitViewComponent<T> = 
  | ((props) => void)
  | ({
new (props): Pick<LitElement, keyof LitElement> & {
  _uiViewProps?: UIViewInjectedProps<T>;
};
  sticky?: boolean;
});
```

Defined in: [packages/lit-ui-router/src/interface.ts:438](https://github.com/simshanith/lit-ui-router/blob/1cd954559604dabdcb4d0a419ac42b07b38f0fba/packages/lit-ui-router/src/interface.ts#L438)

A routed component as a [TypedLitStateDeclaration](TypedLitStateDeclaration.md) checks it, without
inferring the component's own return type.

* A template function returning `void`, which accepts any renderable (as
  Lit's `render(): unknown` does), so the template's body is never inferred.
* A LitElement class, checked against LitElement's public members, so its
  protected `render()` is never inferred.

## Type Parameters

| Type Parameter | Default type |
| ------ | ------ |
|  `T` *extends* [`DefaultResolvesType`](DefaultResolvesType.md) | [`DefaultResolvesType`](DefaultResolvesType.md) |

## Union Members

### Function

```ts
(props) => void
```

***

### Function

```ts
{
new (props): Pick<LitElement, keyof LitElement> & {
  _uiViewProps?: UIViewInjectedProps<T>;
};
  sticky?: boolean;
}
```

The router always passes props; classes may declare the parameter or not.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `props` | [`UIViewInjectedProps`](UIViewInjectedProps.md)<`T`> |

#### Returns

`Pick`<[`LitElement`](https://lit.dev/docs/api/LitElement/), keyof [`LitElement`](https://lit.dev/docs/api/LitElement/)> & {
`_uiViewProps?`: [`UIViewInjectedProps`](UIViewInjectedProps.md)<`T`>;
}

| Name | Type | Description | Defined in |
| ------ | ------ | ------ | ------ |
| `sticky?` | `boolean` | If true, the same component instance is reused across state transitions | [packages/lit-ui-router/src/interface.ts:454](https://github.com/simshanith/lit-ui-router/blob/1cd954559604dabdcb4d0a419ac42b07b38f0fba/packages/lit-ui-router/src/interface.ts#L454) |
