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
Render a React element to its initial HTML. Returns a [Control object](https://github.com/facebook/react/blob/3f8990898309c61c817fbf663f5221d9a00d0eaa/packages/react-dom/src/server/ReactDOMFizzServerNode.js#L49-L54) that allows you to pipe the output or abort the request. Fully supports Suspense and streaming of HTML with "delayed" content blocks "popping in" later through javascript execution. [Read more](https://github.com/reactwg/react-18/discussions/37)
67
+
68
+
If you call [`ReactDOM.hydrateRoot()`](/docs/react-dom-client.html#hydrateroot) on a node that already has this server-rendered markup, React will preserve it and only attach event handlers, allowing you to have a very performant first-load experience.
69
+
70
+
> Note:
71
+
>
72
+
> This is a Node.js specific API and modern server environments should use renderToReadableStream instead.
Streams a React element to its initial HTML. Returns a [Readable Stream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream). Fully supports Suspense and streaming of HTML. [Read more](https://github.com/reactwg/react-18/discussions/127)
103
+
104
+
If you call [`ReactDOM.hydrateRoot()`](/docs/react-dom-client.html#hydrateroot) on a node that already has this server-rendered markup, React will preserve it and only attach event handlers, allowing you to have a very performant first-load experience.
105
+
106
+
```
107
+
let controller = new AbortController();
108
+
try {
109
+
let stream = await renderToReadableStream(
110
+
<html>
111
+
<body>Success</body>
112
+
</html>,
113
+
{
114
+
signal: controller.signal,
115
+
}
116
+
);
117
+
118
+
// This is to wait for all suspense boundaries to be ready. You can uncomment
119
+
// this line if you don't want to stream to the client
0 commit comments