Skip to content

Commit 12ecf5e

Browse files
committed
docs(cn): fix: conflicts
1 parent ee81baa commit 12ecf5e

File tree

4 files changed

+6
-40
lines changed

4 files changed

+6
-40
lines changed

src/content/learn/removing-effect-dependencies.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,11 +1240,7 @@ export default function Timer() {
12401240
12411241
</Sandpack>
12421242
1243-
<<<<<<< HEAD
12441243
你不应在 Effect 中读取 `count`,而是将 `c => c + 1` 指令(“增加此数字!”)传递给 React。React 将在下一次渲染时执行它。由于你不再需要读取 Effect 中 `count` 的值,因此你可以将 Effect 的依赖保持为空(`[]`)。这可以防止 Effect 在每次执行时重新创建定时器 interval。
1245-
=======
1246-
Instead of reading `count` inside the Effect, you pass a `c => c + 1` instruction ("increment this number!") to React. React will apply it on the next render. And since you don't need to read the value of `count` inside your Effect anymore, you can keep your Effect's dependencies empty (`[]`). This prevents your Effect from re-creating the interval on every tick.
1247-
>>>>>>> 2571aee6dba2e9790172a70224dac8371640b772
12481244
12491245
</Solution>
12501246

src/content/learn/reusing-logic-with-custom-hooks.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -820,11 +820,7 @@ export default function ChatRoom({ roomId }) {
820820
// ...
821821
```
822822
823-
<<<<<<< HEAD
824823
并把它作为输入传给另一个 Hook:
825-
=======
826-
and passing it as an input to another Hook:
827-
>>>>>>> 2571aee6dba2e9790172a70224dac8371640b772
828824
829825
```js {6}
830826
export default function ChatRoom({ roomId }) {

src/content/reference/react-dom/preinit.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ function AppRoot() {
4444

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

47-
<<<<<<< HEAD
4847
* `href`:字符串,要下载并执行的资源的 URL。
4948
* `options`:对象,可以包含以下属性:
5049
* `as`:必需的字符串,表示资源的类型,可能的值包括 `script``style`
@@ -53,16 +52,6 @@ function AppRoot() {
5352
* `integrity`:字符串,为资源的加密哈希,用于 [验证其真实性](https://developer.mozilla.org/zh-CN/docs/Web/Security/Subresource_Integrity)
5453
* `nonce`:字符串,表示使用严格内容安全策略时允许资源的 [加密随机数](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Global_attributes/nonce)
5554
* `fetchPriority`:字符串,表示建议获取资源的相对优先级,可能的值为 `auto`(默认值)、`high``low`
56-
=======
57-
* `href`: a string. The URL of the resource you want to download and execute.
58-
* `options`: an object. It contains the following properties:
59-
* `as`: a required string. The type of resource. Its possible values are `script` and `style`.
60-
* `precedence`: a string. Required with stylesheets. Says where to insert the stylesheet relative to others. Stylesheets with higher precedence can override those with lower precedence. The possible values are `reset`, `low`, `medium`, `high`.
61-
* `crossOrigin`: a string. The [CORS policy](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) to use. Its possible values are `anonymous` and `use-credentials`.
62-
* `integrity`: a string. A cryptographic hash of the resource, to [verify its authenticity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity).
63-
* `nonce`: a string. A cryptographic [nonce to allow the resource](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce) when using a strict Content Security Policy.
64-
* `fetchPriority`: a string. Suggests a relative priority for fetching the resource. The possible values are `auto` (the default), `high`, and `low`.
65-
>>>>>>> 2571aee6dba2e9790172a70224dac8371640b772
6655

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

src/content/reference/react-dom/static/prerender.md

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ async function handler(request) {
4949
5050
* `reactNode`:需要渲染为 HTML 的 React 节点。例如,一个像 `<App />` 的 JSX 节点。它应表示整个文档,因此 App 组件应渲染 `<html>` 标签。
5151
52-
<<<<<<< HEAD
5352
* **可选** `options`:一个包含静态生成选项的对象。
5453
* **可选** `bootstrapScriptContent`:如果指定,此字符串将被放置在一个内联的 `<script>` 标签中。
5554
* **可选** `bootstrapScripts`:一个字符串 URL 的数组,用于在页面上生成 `<script>` 标签。使用此选项包含调用 [`hydrateRoot`](/reference/react-dom/client/hydrateRoot) 的 `<script>`。如果不希望在客户端运行 React,可以省略此选项。
@@ -58,18 +57,7 @@ async function handler(request) {
5857
* **可选** `namespaceURI`:流的根 [命名空间 URI](https://developer.mozilla.org/en-US/docs/Web/API/Document/createElementNS#important_namespace_uris) 的字符串。默认为常规 HTML。对于 SVG,请传递 `'http://www.w3.org/2000/svg'`;对于 MathML,请传递 `'http://www.w3.org/1998/Math/MathML'`
5958
* **可选** `onError`:每当发生服务器错误时触发的回调,无论是 [可恢复的](/reference/react-dom/server/renderToReadableStream#recovering-from-errors-outside-the-shell) 还是 [不可恢复的](/reference/react-dom/server/renderToReadableStream#recovering-from-errors-inside-the-shell)。默认情况下,它只调用 `console.error`。如果你重写它用来 [记录崩溃报告](/reference/react-dom/server/renderToReadableStream#logging-crashes-on-the-server) ,请确保仍然调用 `console.error`。你还可以使用它在 shell 被生成之前 [调整状态码](/reference/react-dom/server/renderToReadableStream#setting-the-status-code)。
6059
* **可选** `progressiveChunkSize`:每个块的字节数。[阅读更多关于默认启发式的信息。](https://github.com/facebook/react/blob/14c2be8dac2d5482fda8a0906a31d239df8551fc/packages/react-server/src/ReactFizzServer.js#L210-L225)
61-
* **可选** `signal`:一个 [中止信号](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal),允许你 [中止服务器渲染](/reference/react-dom/server/renderToReadableStream#aborting-server-rendering) 并在客户端渲染剩余内容。
62-
=======
63-
* **optional** `options`: An object with static generation options.
64-
* **optional** `bootstrapScriptContent`: If specified, this string will be placed in an inline `<script>` tag.
65-
* **optional** `bootstrapScripts`: An array of string URLs for the `<script>` tags to emit on the page. Use this to include the `<script>` that calls [`hydrateRoot`.](/reference/react-dom/client/hydrateRoot) Omit it if you don't want to run React on the client at all.
66-
* **optional** `bootstrapModules`: Like `bootstrapScripts`, but emits [`<script type="module">`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) instead.
67-
* **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. Must be the same prefix as passed to [`hydrateRoot`.](/reference/react-dom/client/hydrateRoot#parameters)
68-
* **optional** `namespaceURI`: A string with the root [namespace URI](https://developer.mozilla.org/en-US/docs/Web/API/Document/createElementNS#important_namespace_uris) for the stream. Defaults to regular HTML. Pass `'http://www.w3.org/2000/svg'` for SVG or `'http://www.w3.org/1998/Math/MathML'` for MathML.
69-
* **optional** `onError`: A callback that fires whenever there is a server error, whether [recoverable](/reference/react-dom/server/renderToReadableStream#recovering-from-errors-outside-the-shell) or [not.](/reference/react-dom/server/renderToReadableStream#recovering-from-errors-inside-the-shell) By default, this only calls `console.error`. If you override it to [log crash reports,](/reference/react-dom/server/renderToReadableStream#logging-crashes-on-the-server) make sure that you still call `console.error`. You can also use it to [adjust the status code](/reference/react-dom/server/renderToReadableStream#setting-the-status-code) before the shell is emitted.
70-
* **optional** `progressiveChunkSize`: The number of bytes in a chunk. [Read more about the default heuristic.](https://github.com/facebook/react/blob/14c2be8dac2d5482fda8a0906a31d239df8551fc/packages/react-server/src/ReactFizzServer.js#L210-L225)
71-
* **optional** `signal`: An [abort signal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that lets you [abort prerendering](#aborting-prerendering) and render the rest on the client.
72-
>>>>>>> 2571aee6dba2e9790172a70224dac8371640b772
60+
* **可选** `signal`:一个 [中止信号](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal),允许你 [中止预渲染](#aborting-prerendering) 并在客户端渲染剩余内容。
7361
7462
#### 返回值 {/*returns*/}
7563
@@ -301,12 +289,10 @@ Suspense **无法** 检测在 Effect 或事件处理程序中获取的数据。
301289
302290
---
303291
304-
<<<<<<< HEAD
305-
## 疑难解答 {/*troubleshooting*/}
306-
=======
307-
### Aborting prerendering {/*aborting-prerendering*/}
292+
### 中止预渲染 {/*aborting-prerendering*/}
293+
294+
可以通过设置超时,来强制“终止”预渲染进程:
308295
309-
You can force the prerender to "give up" after a timeout:
310296
311297
```js {2-5,11}
312298
async function renderToString() {
@@ -324,12 +310,11 @@ async function renderToString() {
324310
//...
325311
```
326312
327-
Any Suspense boundaries with incomplete children will be included in the prelude in the fallback state.
313+
所有包含未完成子组件的 Suspense 边界都将以 fallback 状态包含在 prelude 中。
328314
329315
---
330316
331-
## Troubleshooting {/*troubleshooting*/}
332-
>>>>>>> 2571aee6dba2e9790172a70224dac8371640b772
317+
## 疑难解答 {/*troubleshooting*/}
333318
334319
### 我的流要等到整个应用渲染完成后才会启动。 {/*my-stream-doesnt-start-until-the-entire-app-is-rendered*/}
335320

0 commit comments

Comments
 (0)