Static React DOM APIs
react-dom/static API 允许你为 React 组件生成静态 HTML。与流式 API 相比,它们的功能有限。框架 可能会调用它们。你的大多数组件不需要导入或使用它们。
Web 流的静态 API
这些方法仅在支持 Web 流 的环境中可用,包括浏览器、Deno 和一些现代的边缘运行时环境:
prerender使用 可读的 Web 流 将 React 树渲染为静态 HTML。- Experimental only
resumeAndPrerendercontinues a prerendered React tree to static HTML with a Readable Web Stream.
Node.js also includes these methods for compatibility, but they are not recommended due to worse performance. Use the dedicated Node.js APIs instead.
Node.js 流的静态 API
这些方法仅在支持 Node.js 流 的环境中可用:
prerenderToNodeStream使用 Node.js 流 将 React 树渲染为静态 HTML。- Experimental only
resumeAndPrerenderToNodeStreamcontinues a prerendered React tree to static HTML with a Node.js Stream.