Open idev0085 opened 3 years ago
ReactDOMServer
The ReactDOMServer object enables you to render components to static markup. Typically, it’s used on a Node server:
// ES modules import ReactDOMServer from 'react-dom/server'; // CommonJS var ReactDOMServer = require('react-dom/server');
The following methods can be used in both the server and browser environments:
renderToString() renderToStaticMarkup()
These additional methods depend on a package (stream) that is only available on the server, and won’t work in the browser.
renderToNodeStream() renderToStaticNodeStream()
ReactDOMServer
The ReactDOMServer object enables you to render components to static markup. Typically, it’s used on a Node server:
// ES modules import ReactDOMServer from 'react-dom/server'; // CommonJS var ReactDOMServer = require('react-dom/server');
The following methods can be used in both the server and browser environments:
renderToString() renderToStaticMarkup()
These additional methods depend on a package (stream) that is only available on the server, and won’t work in the browser.
renderToNodeStream() renderToStaticNodeStream()