react-dom/server APIs let you render React components to HTML on the server. 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.
These methods are only available in the environments with Node.js Streams:
renderToPipeableStreamrenders a React tree to a pipeable Node.js Stream.
renderToStaticNodeStreamrenders a non-interactive React tree to a Node.js Readable Stream.
These methods are only available in the environments with Web Streams, which includes browsers, Deno, and some modern edge runtimes:
These methods can be used in the environments that don’t support streams:
renderToStringrenders a React tree to a string.
renderToStaticMarkuprenders a non-interactive React tree to a string.
They have limited functionality compared to the streaming APIs.
These APIs will be removed in a future major version of React.