Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ const html = renderToStaticMarkup(<Page />);

#### 参数 {/*parameters*/}

* `reactNode`: A React node you want to render to HTML. For example, a JSX node like `<Page />`.
* **optional** `options`: An object for server render.
* **optional** `identifierPrefix`: A string prefix React uses for IDs generated by [`useId`.](/reference/react/useId) Useful to avoid conflicts when using multiple roots on the same page.
* `reactNode`:你想要渲染到 HTML 的 React 节点。例如像是 `<Page />` 之类的 JSX。
* **可选的** `options`:一个服务器渲染的对象。
* **可选的** `identifierPrefix`:一个 React 使用 [`useId`](/reference/react/useId) 生成的 ID 的字符串前缀,用于避免在同一页面上使用多个 root 时发生冲突。

#### 返回值 {/*returns*/}

Expand All @@ -55,7 +55,6 @@ const html = renderToStaticMarkup(<Page />);
## 用法 {/*usage*/}

### 将一个非交互式的 React 树渲染成 HTML 字符串 {/*rendering-a-non-interactive-react-tree-as-html-to-a-string*/}
``

调用 `renderToStaticMarkup` 将你的应用程序渲染为 HTML 字符串,然后将其与服务器响应一起发送:

Expand Down