idev0085 / react-boilerplate

0 stars 0 forks source link

What is ReactDOMServer? #66

Open idev0085 opened 3 years ago

idev0085 commented 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()