Skip to content

Commit ac6ac4c

Browse files
authored
docs(en): merge reactjs.org/main into zh-hans.reactjs.org/main @ 84a5696 (#1735)
2 parents ce41101 + 4c72f01 commit ac6ac4c

File tree

8 files changed

+11
-17
lines changed

8 files changed

+11
-17
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"@radix-ui/react-context-menu": "^2.1.5",
3131
"body-scroll-lock": "^3.1.3",
3232
"classnames": "^2.2.6",
33-
"date-fns": "^2.16.1",
3433
"debounce": "^1.2.1",
3534
"github-slugger": "^1.3.0",
3635
"next": "15.1.0",

src/content/learn/scaling-up-with-reducer-and-context.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ ul, li { margin: 0; padding: 0; }
690690
</TasksContext>
691691
```
692692

693-
相反,任何需要 tasks 的组件都可以从 `TaskContext` 中读取它:
693+
相反,任何需要 tasks 的组件都可以从 `TasksContext` 中读取它:
694694

695695
```js {2}
696696
export default function TaskList() {

src/content/reference/react-dom/client/createRoot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ React 将会在 `根节点` 中显示 `<App />` 组件,并且控制组件中
9090
9191
如果你在一个根节点上多次调用了 `render`,React 仍然会更新 DOM,这样才能保证显示的内容是最新的。React 将会筛选出可复用的部分和需要更新的部分,对于需要更新的部分,是 React 通过与之前渲染的树进行 [“比较”](/learn/preserving-and-resetting-state) 得到的。在同一个根节点上再次调用 `render` 就和在根节点上调用 [`set` 函数](/reference/react/useState#setstate) 类似:React 会避免没必要的 DOM 更新。
9292
93-
* Although rendering is synchronous once it starts, `root.render(...)` is not. This means code after `root.render()` may run before any effects (`useLayoutEffect`, `useEffect`) of that specific render are fired. This is usually fine and rarely needs adjustment. In rare cases where effect timing matters, you can wrap `root.render(...)` in [`flushSync`](https://react.dev/reference/react-dom/client/flushSync) to ensure the initial render runs fully synchronously.
93+
* Although rendering is synchronous once it starts, `root.render(...)` is not. This means code after `root.render()` may run before any effects (`useLayoutEffect`, `useEffect`) of that specific render are fired. This is usually fine and rarely needs adjustment. In rare cases where effect timing matters, you can wrap `root.render(...)` in [`flushSync`](https://react.dev/reference/react-dom/flushSync) to ensure the initial render runs fully synchronously.
9494
9595
```js
9696
const root = createRoot(document.getElementById('root'));

src/content/reference/react/forwardRef.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: forwardRef
66

77
In React 19, `forwardRef` is no longer necessary. Pass `ref` as a prop instead.
88

9-
`forwardRef` will deprecated in a future release. Learn more [here](/blog/2024/04/25/react-19#ref-as-a-prop).
9+
`forwardRef` will be deprecated in a future release. Learn more [here](/blog/2024/04/25/react-19#ref-as-a-prop).
1010

1111
</Deprecated>
1212

src/content/reference/rsc/directives.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ title: "指示符"
1010

1111
<Intro>
1212

13-
指示符(directive)向 [与 React 服务器组件兼容的捆绑器](/learn/start-a-new-react-project#bleeding-edge-react-frameworks) 提供指令(instruction)。
13+
指示符(directive)向 [与 React 服务器组件兼容的捆绑器](/learn/start-a-new-react-project#full-stack-frameworks) 提供指令(instruction)。
1414

1515
</Intro>
1616

src/content/reference/rsc/server-components.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: 服务器组件
44

55
<RSC>
66

7-
服务器组件被用在 [React 服务器组件](/learn/start-a-new-react-project#bleeding-edge-react-frameworks) 中。
7+
服务器组件被用在 [React 服务器组件](/learn/start-a-new-react-project#full-stack-frameworks) 中。
88

99
</RSC>
1010

@@ -45,7 +45,7 @@ function Page({page}) {
4545
setContent(data.content);
4646
});
4747
}, [page]);
48-
48+
4949
return <div>{sanitizeHtml(marked(content))}</div>;
5050
}
5151
```
@@ -69,7 +69,7 @@ import sanitizeHtml from 'sanitize-html'; // 不会包括在 bundle 中
6969
async function Page({page}) {
7070
// 注意: 会在应用构建的 **渲染过程中** 加载
7171
const content = await file.readFile(`${page}.md`);
72-
72+
7373
return <div>{sanitizeHtml(marked(content))}</div>;
7474
}
7575
```
@@ -113,7 +113,7 @@ function Note({id}) {
113113
setNote(data.note);
114114
});
115115
}, [id]);
116-
116+
117117
return (
118118
<div>
119119
<Author id={note.authorId} />
@@ -253,7 +253,7 @@ export default function Expandable({children}) {
253253
<p>this is the second note</p>
254254
</Expandable>
255255
<!--...-->
256-
</div>
256+
</div>
257257
</body>
258258
```
259259

@@ -270,7 +270,7 @@ import db from './database';
270270
async function Page({id}) {
271271
// 使用 await 会使服务器组件暂停
272272
const note = await db.notes.get(id);
273-
273+
274274
// 注意: 没有使用 await, 所以从这里开始执行,但是客户端上面进行 await
275275
const commentsPromise = db.comments.get(note.id);
276276
return (

src/content/reference/rsc/use-client.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default function RichTextEditor({ timestamp, text }) {
4141
}
4242
```
4343

44-
当从服务器组件导入带有 `'use client'` 标记的文件时,[兼容的捆绑工具](/learn/start-a-new-react-project#bleeding-edge-react-frameworks) 将模块导入视为服务器运行和客户端运行代码之间的边界。
44+
当从服务器组件导入带有 `'use client'` 标记的文件时,[兼容的捆绑工具](/learn/start-a-new-react-project#full-stack-frameworks) 将模块导入视为服务器运行和客户端运行代码之间的边界。
4545

4646
作为 `RichTextEditor` 的依赖项,无论 `formatDate``Button` 的模块是否包含 `'use client'`,其都将在客户端上进行评估。请注意,当从服务器代码导入时,单个模块可能在服务器上进行评估,并且当从客户端代码导入时,可能在客户端上进行评估。
4747

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2799,11 +2799,6 @@ data-view-byte-offset@^1.0.0:
27992799
es-errors "^1.3.0"
28002800
is-data-view "^1.0.1"
28012801

2802-
date-fns@^2.16.1:
2803-
version "2.28.0"
2804-
resolved "https://registry.npmjs.org/date-fns/-/date-fns-2.28.0.tgz"
2805-
integrity sha512-8d35hViGYx/QH0icHYCeLmsLmMUheMmTyV9Fcm6gvNwdw31yXXH+O85sOBJ+OLnLQMKZowvpKb6FgMIQjcpvQw==
2806-
28072802
debounce@^1.2.1:
28082803
version "1.2.1"
28092804
resolved "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz"

0 commit comments

Comments
 (0)