Skip to content

Commit 2a229aa

Browse files
committed
docs: clarify that resumeAndPrerender prelude stream is partial when postponed
Clarifies in the resumeAndPrerender reference documentation that the returned prelude stream is not necessarily a standalone, complete HTML document if rendering was postponed or aborted, preventing confusion where developers attempt to send the prelude directly as the entire HTTP response body. Fixes #8755
1 parent 46a54e0 commit 2a229aa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/content/reference/react-dom/static/resumeAndPrerender.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ On the client, call [`hydrateRoot`](/reference/react-dom/client/hydrateRoot) to
6060
6161
`prerender` returns a Promise:
6262
- If rendering the is successful, the Promise will resolve to an object containing:
63-
- `prelude`: a [Web Stream](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) of HTML. You can use this stream to send a response in chunks, or you can read the entire stream into a string.
63+
- `prelude`: a [Web Stream](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) of HTML containing the rendered shell and resolved segments. Note that this stream is not necessarily a complete HTML document if rendering was postponed or aborted. To deliver a complete response to a browser, combine the static prelude with the resumed stream or ensure `<App />` renders root `<html>` and `<body>` tags without unhandled postponed boundaries.
6464
- `postponed`: an JSON-serializeable, opaque object that can be passed to [`resume`](/reference/react-dom/server/resume) or [`resumeAndPrerender`](/reference/react-dom/static/resumeAndPrerender) if `prerender` is aborted.
6565
- If rendering fails, the Promise will be rejected. [Use this to output a fallback shell.](/reference/react-dom/server/renderToReadableStream#recovering-from-errors-inside-the-shell)
6666

0 commit comments

Comments
 (0)