Like renderToStaticMarkup but with suspense support.
npm install react-render-to-stringLike renderToStaticMarkup but with suspense support.
The module is intended to be used with static site generators that support data fetching inside components rather than upfront.
It internally uses renderToReadableStream and captures the result as string.
The package exports two different implementations, one for modern environments that support Web Streams, and one that uses renderToPipeableStream instead.
Note: Node.js supports Web Streams since v.16.5.0, but the exports map of react-dom/server specifies a special build for "node" that does not include renderToReadableStream. Therefore, this package does the same and falls back to renderToPipeableStream.
``js
import renderToString from "react-render-to-string";
import { App } from "./App";
const html = await renderToString(
``