[]previous and next page

HydrateOptions

Options of hydrate: the server render it continues, the root's owner, and the error reporters it inherits from RootErrorOptions (onUncaughtError, onCaughtError, onRecoverableError).

Options of hydrate: the server render it continues, the root's owner, and the error reporters it inherits from RootErrorOptions (onUncaughtError, onCaughtError, onRecoverableError).

Import#

ts
import type { HydrateOptions } from "@shadow-js/web";

Signature#

ts
interface HydrateOptions extends RootErrorOptions {
  /**
   * The id the server render used, so the client numbers its elements with the same keys. Must
   * equal the `renderId` given to the server render.
   * @default "0"
   */
  renderId?: string;
  /**
   * The resource values the server fetched: the `data` of `renderToStringAsync`. A resource whose
   * key is found here starts with that value instead of fetching it again. Each value is used once.
   * @default {} (no resource value is preloaded; resources fetch on the client)
   */
  data?: Record<string, unknown>;
  /**
   * The owner the hydrated root is created under, so its context (providers) is visible to the app.
   * @default null (the root has no parent owner)
   */
  owner?: Owner;
}

Members#

Name Type Description
renderId? renderId?: string The id the server render used, so the client numbers its elements with the same keys. Must equal the renderId given to the server render.
data? data?: Record<string, unknown> The resource values the server fetched: the data of renderToStringAsync. A resource whose key is found here starts with that value instead of fetching it again. Each value is used once.
owner? owner?: Owner The owner the hydrated root is created under, so its context (providers) is visible to the app.