Cookbook / SSR Hydration

SSR Hydration

ssr-ssg

SSR-safe bootstrapping — props render placeholders on the server; onMount reads server-stamped dataset values after hydration.

id
ssr-hydration
since
0.5.0
file
ssr-hydration.aihu
propstateonMountinterpolation

Run it

source · static

This recipe doesn't have a hydrated island in the demo gallery yet. An in-browser, WASM-compiled playground (edit this source and re-render live) is planned as a follow-up — read the real source below.

Source

ssr-hydration.aihu

Requires

concerns
stateserialization

Anti-patterns

  • Do not touch the DOM or dataset during setup — SSR executes setup on the server; DOM reads belong in onMount.

Related recipes