Skip to content

Hydratable · Next.js server API

type Hydratable<TSnapshot> = object;

Entity that can expose and restore a serializable state snapshot.

The snapshot, not the DI container, is what crosses the RSC/client boundary.

Type Parameter

TSnapshot extends Serializable

dehydrate(): TSnapshot;

Returns the minimal serializable state needed by the client.

TSnapshot


hydrate(snapshot): void;

Restores state from a previously serialized snapshot.

Parameter Type

snapshot

TSnapshot

void