0% found this document useful (0 votes)
3 views

Server React DOM APIs – React

The Server React DOM APIs allow for server-side rendering of React components to HTML, primarily used at the top level of applications. There are specific methods for Node.js Streams and Web Streams, including renderToPipeableStream and renderToReadableStream, as well as legacy methods like renderToString and renderToStaticMarkup for non-streaming environments. These legacy methods offer limited functionality compared to the streaming APIs.

Uploaded by

dungeon.dad87
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Server React DOM APIs – React

The Server React DOM APIs allow for server-side rendering of React components to HTML, primarily used at the top level of applications. There are specific methods for Node.js Streams and Web Streams, including renderToPipeableStream and renderToReadableStream, as well as legacy methods like renderToString and renderToStaticMarkup for non-streaming environments. These legacy methods offer limited functionality compared to the streaming APIs.

Uploaded by

dungeon.dad87
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

20/02/2025, 19:15 Server React DOM APIs – React

v19

API REFERENCE

Server React DOM APIs


The react-dom/server APIs let you server-side render React
components to HTML. These APIs are only used on the server at
the top level of your app to generate the initial HTML. A
framework may call them for you. Most of your components don’t
need to import or use them.

Server APIs for Node.js Streams


These methods are only available in the environments with Node.js Streams:

renderToPipeableStream renders a React tree to a pipeable Node.js


Stream.

Server APIs for Web Streams


These methods are only available in the environments with Web Streams,
which includes browsers, Deno, and some modern edge runtimes:

renderToReadableStream renders a React tree to a Readable Web


Stream.

Legacy Server APIs for non-streaming


environments
These methods can be used in the environments that don’t support streams:

renderToString renders a React tree to a string.

https://react.dev/reference/react-dom/server 1/3
20/02/2025, 19:15 Server React DOM APIs – React

renderToStaticMarkup renders a non-interactive React tree to a string.

They have limited functionality compared to the streaming APIs.

PREVIOUS

hydrateRoot

NEXT

renderToPipeableStream

Copyright © Meta Platforms, Inc

uwu?

Learn React API Reference

Quick Start React APIs

Installation React DOM APIs

Describing the UI

Adding Interactivity

Managing State

Escape Hatches

Community More

Code of Conduct Blog

Meet the Team React Native

Docs Contributors Privacy

Acknowledgements Terms

https://react.dev/reference/react-dom/server 2/3
20/02/2025, 19:15 Server React DOM APIs – React

https://react.dev/reference/react-dom/server 3/3

You might also like