AsyncRenderResult
What renderToStringAsync resolves to: the markup and the resource data to embed for hydration.
What renderToStringAsync resolves to: the markup and the resource data to embed for hydration.
Import#
ts
import type { AsyncRenderResult } from "@shadow-js/web/server";
Signature#
ts
interface AsyncRenderResult {
/** The markup of the last pass. */
readonly html: string;
/**
* The resolved resource values the last pass read, keyed as the client looks them up. Embed it in
* the page with {@link serialize} and pass it to `hydrate()` as its `data` option, so the client
* reuses the values instead of fetching again.
*/
readonly data: Record<string, unknown>;
}
Members#
| Name | Type | Description |
|---|---|---|
html |
readonly html: string |
The markup of the last pass. |
data |
readonly data: Record<string, unknown> |
The resolved resource values the last pass read, keyed as the client looks them up. Embed it in the page with serialize and pass it to hydrate() as its data option, so the client reuses the values instead of fetching again. |