hydrate · Next.js client API
function hydrate<TSchema>(options): void;Restores serializable snapshots into hydratable entities declared in a schema.
Use this with a client-safe container and the snapshot received through a Client Component prop.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
|
|
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
|
Client container, matching schema, and server snapshot. |
Returns
Section titled “Returns”void
Example
Section titled “Example”hydrate({ container: clientContainer, schema: hydration, snapshot,});Throws
Section titled “Throws”Error when the schema contains a missing token or the snapshot is
missing a required key.