Skip to content

Commit

Permalink
docs(cn): translate reference/react-dom/server/index into Chinese (#1202
Browse files Browse the repository at this point in the history
)

Co-authored-by: Xavi Lee <awxiaoxian2020@163.com>
  • Loading branch information
Yucohny and awxiaoxian2020 authored Jun 21, 2023
1 parent 0f027bd commit 6c1da38
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/content/reference/react-dom/server/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,46 @@ title: Server React DOM APIs

<Intro>

The `react-dom/server` APIs let you render React components to HTML on the server. These APIs are only used on the server at the top level of your app to generate the initial HTML. A [framework](/learn/start-a-new-react-project#production-grade-react-frameworks) may call them for you. Most of your components don't need to import or use them.
`react-dom/server` API 允许你在服务器上将 React 组件渲染为 HTML。这些 API 仅在顶层应用程序服务器上使用,用于生成初始 HTML。有的 [框架](/learn/start-a-new-react-project#production-grade-react-frameworks) 可能会为你调用相关 API,大多数组件不需要导入或使用这些 API。

</Intro>

---

## Server APIs for Node.js Streams {/*server-apis-for-nodejs-streams*/}
## Node.js 流服务器 API {/*server-apis-for-nodejs-streams*/}

These methods are only available in the environments with [Node.js Streams:](https://nodejs.org/api/stream.html)
以下方法仅在具有 [Node.js ](https://nodejs.org/api/stream.html) 的环境中可用:

* [`renderToPipeableStream`](/reference/react-dom/server/renderToPipeableStream) renders a React tree to a pipeable [Node.js Stream.](https://nodejs.org/api/stream.html)
* [`renderToStaticNodeStream`](/reference/react-dom/server/renderToStaticNodeStream) renders a non-interactive React tree to a [Node.js Readable Stream.](https://nodejs.org/api/stream.html#readable-streams)
* [`renderToPipeableStream`](/reference/react-dom/server/renderToPipeableStream) React 树渲染为可传输的 [Node.js ](https://nodejs.org/api/stream.html)
* [`renderToStaticNodeStream`](/reference/react-dom/server/renderToStaticNodeStream) 将非交互式 React 树渲染为 [Node.js 可读流](https://nodejs.org/api/stream.html#readable-streams)

---

## Server APIs for Web Streams {/*server-apis-for-web-streams*/}
## Web 流服务器 API {/*server-apis-for-web-streams*/}

These methods are only available in the environments with [Web Streams](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API), which includes browsers, Deno, and some modern edge runtimes:
以下方法仅在具有 [Web ](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) 的环境中可用,包括浏览器、Deno,以及一些现代 edge 运行时:

* [`renderToReadableStream`](/reference/react-dom/server/renderToReadableStream) renders a React tree to a [Readable Web Stream.](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream)
+ [`renderToReadableStream`](/reference/react-dom/server/renderToReadableStream) React 树渲染为 [可读的 Web ](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream)

---

## Server APIs for non-streaming environments {/*server-apis-for-non-streaming-environments*/}
## 非流式环境 API {/*server-apis-for-non-streaming-environments*/}

These methods can be used in the environments that don't support streams:
以下方法可以在非流式环境中使用:

* [`renderToString`](/reference/react-dom/server/renderToString) renders a React tree to a string.
* [`renderToStaticMarkup`](/reference/react-dom/server/renderToStaticMarkup) renders a non-interactive React tree to a string.
* [`renderToString`](/reference/react-dom/server/renderToString) React 树渲染为字符串。
* [`renderToStaticMarkup`](/reference/react-dom/server/renderToStaticMarkup) 将非交互式 React 树渲染为字符串。

They have limited functionality compared to the streaming APIs.
相比于流式 API,这些 API 在功能上有些限制。

---

## Deprecated server APIs {/*deprecated-server-apis*/}
## 已弃用的服务器 API {/*deprecated-server-apis*/}

<Deprecated>

These APIs will be removed in a future major version of React.
这些 API 将在未来的 React 主要版本中被移除。

</Deprecated>

* [`renderToNodeStream`](/reference/react-dom/server/renderToNodeStream) renders a React tree to a [Node.js Readable stream.](https://nodejs.org/api/stream.html#readable-streams) (Deprecated.)
* [`renderToNodeStream`](/reference/react-dom/server/renderToNodeStream) [Node.js 只读流](https://nodejs.org/api/stream.html#readable-streams) 渲染 React 树(已弃用)。

0 comments on commit 6c1da38

Please sign in to comment.