0 votes
11 views
in React JS by (1.1k points)
ReactDOMServer renderToStaticMarkup()

1 Answer

0 votes
by (1.1k points)
ReactDOMServer.renderToStaticMarkup(element)

Similar to renderToString, except this doesn’t create extra DOM attributes that React uses internally, such as data-reactroot. This is useful if you want to use React as a simple static page generator, as stripping away the extra attributes can save some bytes.

If you plan to use React on the client to make the markup interactive, do not use this method. Instead, use renderToString on the server and ReactDOM.hydrate() on the client

Related questions

0 votes
24 views
asked Dec 14, 2019 in React JS by AdilsonLima (1.1k points)
0 votes
11 views
asked Dec 14, 2019 in React JS by AdilsonLima (1.1k points)
0 votes
9 views
asked Dec 14, 2019 in React JS by AdilsonLima (1.1k points)
0 votes
9 views
asked Dec 14, 2019 in React JS by AdilsonLima (1.1k points)
0 votes
1 view
asked 1 day ago in React JS by anonymous
...