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 Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
|
|
Methods
Section titled “Methods”dehydrate()
Section titled “dehydrate()”dehydrate(): TSnapshot;Returns the minimal serializable state needed by the client.
Returns
Section titled “Returns”TSnapshot
hydrate()
Section titled “hydrate()”hydrate(snapshot): void;Restores state from a previously serialized snapshot.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”void