---
url: https://lit-ui-router.dev/api/ui-router-server/ssr/functions/dehydrate.md
---
[ui-router-server](../../index.md) / [ssr](../index.md) / dehydrate

# Function: dehydrate()

```ts
function dehydrate(transition): DehydrateResult;
```

Defined in: [dehydrate.ts:54](https://github.com/simshanith/lit-ui-router/blob/1cd954559604dabdcb4d0a419ac42b07b38f0fba/packages/ui-router-server/src/dehydrate.ts#L54)

Draws the resolve payload from a transition that has landed, such as the
one [\`settle\`](settle.md) hands back: every resolved value of every state
on its path, keyed by state name and token, and the state and url
parameters it was drawn for.

Only the resolves a state declares with a string token are drawn. A value
goes in when it is [plain JSON data](../type-aliases/JsonValue.md): `null`, a boolean, a
string, a finite number, or an array or plain object of those, with no
cycle. Anything else (a `Date`, a `Map`, a class instance, `undefined`,
`NaN`) is listed in
[\`unserializable\`](../interfaces/DehydrateResult.md#unserializable) instead and
re-runs on the client, so an adopted value never differs from the one the
server resolved.

A `NOWAIT` resolve stays with the client: it is neither awaited nor drawn,
nor listed, and the client runs it as it would without a payload.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `transition` | [`Transition`](https://ui-router.github.io/core/docs/latest/classes/_transition_transition_.transition.html) | a transition that has landed |

## Returns

[`DehydrateResult`](../interfaces/DehydrateResult.md)

the payload, and the resolves left out of it

## Example

```ts
import { dehydrate, settle } from 'ui-router-server/ssr';

const { payload, unserializable } = dehydrate(await settle(router, path));

for (const { state, token } of unserializable)
  console.warn(`${path}: ${state}.${token} re-runs on the client`);
```
