renderToStaticMarkup – React
renderToStaticMarkup – React
v19
renderToStaticMarkup
renderToStaticMarkup renders a non-interactive React tree to an
HTML string.
Reference
renderToStaticMarkup(reactNode, options?)
Usage
Reference
renderToStaticMarkup(reactNode, options?)
Parameters
https://react.dev/reference/react-dom/server/renderToStaticMarkup 1/4
20/02/2025, 19:15 renderToStaticMarkup – React
Returns
An HTML string.
Caveats
Usage
https://react.dev/reference/react-dom/server/renderToStaticMarkup 2/4
20/02/2025, 19:15 renderToStaticMarkup – React
});
This will produce the initial non-interactive HTML output of your React
components.
Pitfall
PREVIOUS
renderToReadableStream
NEXT
renderToString
uwu?
https://react.dev/reference/react-dom/server/renderToStaticMarkup 3/4
20/02/2025, 19:15 renderToStaticMarkup – React
Describing the UI
Adding Interactivity
Managing State
Escape Hatches
Community More
Acknowledgements Terms
https://react.dev/reference/react-dom/server/renderToStaticMarkup 4/4