Skip to content

Commit de7692a

Browse files
committed
update
1 parent 30e49f0 commit de7692a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/routes/reference/rendering/hydration-script.mdx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ tags:
1010
- events
1111
version: "1.0"
1212
description: >-
13-
Emit the hydration bootstrap script with `HydrationScript` or
13+
Generate the SSR hydration bootstrap script with `HydrationScript` or
1414
`generateHydrationScript`.
1515
---
1616

17-
`HydrationScript` and `generateHydrationScript` emit Solid's hydration bootstrap script.
17+
`HydrationScript` and `generateHydrationScript` generate Solid's SSR hydration bootstrap script.
1818

1919
## Import
2020

@@ -70,10 +70,10 @@ Delegated event names captured before client scripts load.
7070

7171
## Behavior
7272

73-
- The hydration script bootstraps delegated event replay before the runtime loads.
74-
- `HydrationScript` returns JSX for server-rendered HTML output.
75-
- `generateHydrationScript` returns a string for manual HTML generation.
76-
- In browser-only bundles, these exports are no-op placeholders.
73+
- The generated script initializes `window._$HY` and bootstraps delegated event replay before the runtime loads.
74+
- The default captured delegated events are `"click"` and `"input"` unless `eventNames` is overridden.
75+
- `HydrationScript` returns JSX for server-rendered HTML output, and `generateHydrationScript` returns a string for manual HTML generation.
76+
- In browser bundles, these exports are placeholders that return `undefined`.
7777

7878
## Examples
7979

@@ -82,6 +82,7 @@ Delegated event names captured before client scripts load.
8282
```tsx
8383
import { HydrationScript } from "solid-js/web";
8484

85+
// Use when generating HTML on the server
8586
<head>
8687
<HydrationScript />
8788
</head>;

0 commit comments

Comments
 (0)