---
url: >-
  https://lit-ui-router.dev/reference/lit-ui-router/controllers/TransitionCallback.md
---
[lit-ui-router](../index.md) / TransitionCallback

# Type Alias: TransitionCallback

```ts
type TransitionCallback = (transition, reason) => unknown;
```

Defined in: [packages/lit-ui-router/src/transition-controller.ts:60](https://github.com/simshanith/lit-ui-router/blob/740888c2b2ba358c4dfa52a122e927df6a604b12/packages/lit-ui-router/src/transition-controller.ts#L60)

A callback invoked by [TransitionController](TransitionController.md) whenever the host is
synchronized with the router.

For `'onBefore'` and `'onStart'` reasons, the returned value is passed
back to UI-Router as a
[HookResult](https://ui-router.github.io/core/docs/latest/modules/_transition_interface_.html#hookresult),
so the callback may cancel or redirect the pending transition.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `transition` | | [`Transition`](https://ui-router.github.io/core/docs/latest/classes/_transition_transition_.transition.html) | `undefined` | The [Transition](https://ui-router.github.io/core/docs/latest/classes/_transition_transition_.transition.html) which triggered the callback. For the `'hostConnected'` reason this is the most recent successful transition, or `undefined` when no transition has succeeded yet. |
| `reason` | [`TransitionCallbackReason`](TransitionCallbackReason.md) | Why the callback was invoked (see [TransitionCallbackReason](TransitionCallbackReason.md)). |

## Returns

`unknown`
