ReactDOMServer: renderToStaticMarkup()

renderToStaticMarkup()

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.

Related concepts

renderToStaticMarkup()

ReactDOMServer: renderToStaticMarkup() — Structure map

Clickable & Draggable!

ReactDOMServer: renderToStaticMarkup() — Related pages: