You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix: correct overlay highlighting in code examples (#7669)
* fix: the value property of checkbox to the checked property (#7804)
* No need for useState here — useCounter handles the state internally (#7803)
* docs: fix misplaced prepositional phrase error (#7799)
* Fix wrong documentation for effect events (#7800)
* Fix wrong documentation for effect events
* Update src/content/learn/separating-events-from-effects.md
---------
Co-authored-by: Ricky <[email protected]>
* Remove stray console.log and image (#7814)
* fix(template): remove unnecessary import of React in template code (#7750)
* fix(reference): correct singular form of 'Server Functions' to 'Server Function' (#7749)
* Add bold mono font (#7815)
---------
Co-authored-by: Nicolas Ettlin <[email protected]>
* Remove TODO comments and convert them to issues (#7743)
* Remove TODO comment and convert to an issue for react-test-renderer
* Remove TODO comment and convert to an issue for react-dom/test-utils
* Add example of `useActionState` handling execution order (#7733)
* docs: update vite link (#7784)
* docs: add bsky link (#7781)
* docs: add bsky link
rename twitter to x
* Update src/content/community/index.md
---------
Co-authored-by: Ricky <[email protected]>
* React Montreal Meetings have a new link (#7809)
* fix: remove useless content (#6615)
* fix: wrong verb tense in doc (#7818)
* fix: typo in challenge solution (#7816)
* Use experiemental in all uEE doc sandboxes (#7820)
* Author: Josh Story <[email protected]>
Date: 2025-05-21 11:01:46 -0700
clarify the nonce and signal options for prerender docs
clarifies why nonce is not an option for prerender APIs.
clarifies how you would use signal to abort a prerender with in page documentation
---------
Co-authored-by: Mohammad Reza Badri <[email protected]>
Co-authored-by: kosh <[email protected]>
Co-authored-by: Gourav Bhardwaj <[email protected]>
Co-authored-by: Mehmet Mallı <[email protected]>
Co-authored-by: Ricky <[email protected]>
Co-authored-by: Ryosuke Hoda <[email protected]>
Co-authored-by: Nicolas Ettlin <[email protected]>
Co-authored-by: Bartosz Klonowski <[email protected]>
Co-authored-by: Ajit <[email protected]>
Co-authored-by: bornkiss <[email protected]>
Co-authored-by: Eric Cote <[email protected]>
Co-authored-by: Xleine <[email protected]>
Co-authored-by: Ayman Alhourani <[email protected]>
Co-authored-by: Josh Story <[email protected]>
Copy file name to clipboardExpand all lines: src/content/reference/react-dom/static/prerender.md
+27-1Lines changed: 27 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ On the client, call [`hydrateRoot`](/reference/react-dom/client/hydrateRoot) to
57
57
* **optional** `namespaceURI`: A string with the root [namespace URI](https://developer.mozilla.org/en-US/docs/Web/API/Document/createElementNS#important_namespace_uris) for the stream. Defaults to regular HTML. Pass `'http://www.w3.org/2000/svg'` for SVG or `'http://www.w3.org/1998/Math/MathML'` for MathML.
58
58
* **optional** `onError`: A callback that fires whenever there is a server error, whether [recoverable](/reference/react-dom/server/renderToReadableStream#recovering-from-errors-outside-the-shell) or [not.](/reference/react-dom/server/renderToReadableStream#recovering-from-errors-inside-the-shell) By default, this only calls `console.error`. If you override it to [log crash reports,](/reference/react-dom/server/renderToReadableStream#logging-crashes-on-the-server) make sure that you still call `console.error`. You can also use it to [adjust the status code](/reference/react-dom/server/renderToReadableStream#setting-the-status-code) before the shell is emitted.
59
59
* **optional** `progressiveChunkSize`: The number of bytes in a chunk. [Read more about the default heuristic.](https://github.com/facebook/react/blob/14c2be8dac2d5482fda8a0906a31d239df8551fc/packages/react-server/src/ReactFizzServer.js#L210-L225)
60
-
* **optional** `signal`: An [abort signal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that lets you [abort server rendering](/reference/react-dom/server/renderToReadableStream#aborting-server-rendering) and render the rest on the client.
60
+
* **optional** `signal`: An [abort signal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that lets you [abort prerendering](#aborting-prerendering) and render the rest on the client.
61
61
62
62
#### Returns {/*returns*/}
63
63
@@ -66,7 +66,9 @@ On the client, call [`hydrateRoot`](/reference/react-dom/client/hydrateRoot) to
66
66
- `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.
67
67
- 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)
68
68
69
+
#### Caveats {/*caveats*/}
69
70
71
+
`nonce` is not an available option when prerendering. Nonces must be unique per request and if you use nonces to secure your application with [CSP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP) it would be inappropriate and insecure to include the a nonce value in the prerender itself.
70
72
71
73
72
74
<Note>
@@ -287,6 +289,30 @@ Suspense-enabled data fetching without the use of an opinionated framework is no
Copy file name to clipboardExpand all lines: src/content/reference/react-dom/static/prerenderToNodeStream.md
+29-1Lines changed: 29 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ On the client, call [`hydrateRoot`](/reference/react-dom/client/hydrateRoot) to
58
58
* **optional** `namespaceURI`: A string with the root [namespace URI](https://developer.mozilla.org/en-US/docs/Web/API/Document/createElementNS#important_namespace_uris) for the stream. Defaults to regular HTML. Pass `'http://www.w3.org/2000/svg'` for SVG or `'http://www.w3.org/1998/Math/MathML'` for MathML.
59
59
* **optional** `onError`: A callback that fires whenever there is a server error, whether [recoverable](/reference/react-dom/server/renderToPipeableStream#recovering-from-errors-outside-the-shell) or [not.](/reference/react-dom/server/renderToPipeableStream#recovering-from-errors-inside-the-shell) By default, this only calls `console.error`. If you override it to [log crash reports,](/reference/react-dom/server/renderToPipeableStream#logging-crashes-on-the-server) make sure that you still call `console.error`. You can also use it to [adjust the status code](/reference/react-dom/server/renderToPipeableStream#setting-the-status-code) before the shell is emitted.
60
60
* **optional** `progressiveChunkSize`: The number of bytes in a chunk. [Read more about the default heuristic.](https://github.com/facebook/react/blob/14c2be8dac2d5482fda8a0906a31d239df8551fc/packages/react-server/src/ReactFizzServer.js#L210-L225)
61
-
* **optional** `signal`: An [abort signal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that lets you [abort server rendering](/reference/react-dom/server/renderToPipeableStream#aborting-server-rendering) and render the rest on the client.
61
+
* **optional** `signal`: An [abort signal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that lets you [abort prerendering](#aborting-prerendering) and render the rest on the client.
62
62
63
63
#### Returns {/*returns*/}
64
64
@@ -67,6 +67,10 @@ On the client, call [`hydrateRoot`](/reference/react-dom/client/hydrateRoot) to
67
67
- `prelude`: a [Node.js Stream.](https://nodejs.org/api/stream.html) of HTML. You can use this stream to send a response in chunks, or you can read the entire stream into a string.
68
68
- If rendering fails, the Promise will be rejected. [Use this to output a fallback shell.](/reference/react-dom/server/renderToPipeableStream#recovering-from-errors-inside-the-shell)
69
69
70
+
#### Caveats {/*caveats*/}
71
+
72
+
`nonce` is not an available option when prerendering. Nonces must be unique per request and if you use nonces to secure your application with [CSP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP) it would be inappropriate and insecure to include the a nonce value in the prerender itself.
73
+
70
74
<Note>
71
75
72
76
### When should I use `prerenderToNodeStream`? {/*when-to-use-prerender*/}
@@ -285,6 +289,30 @@ Suspense-enabled data fetching without the use of an opinionated framework is no
0 commit comments