Skip to content

Commit 981c9cf

Browse files
authored
fix conflict
1 parent 111288f commit 981c9cf

File tree

11 files changed

+15
-119
lines changed

11 files changed

+15
-119
lines changed

.github/workflows/analyze_comment.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@ on:
66
types:
77
- completed
88

9-
<<<<<<< HEAD
10-
=======
119
permissions:
1210
contents: read
1311
issues: write
1412
pull-requests: write
1513

16-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91
1714
jobs:
1815
comment:
1916
runs-on: ubuntu-latest

src/content/blog/2024/12/05/react-19.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -410,11 +410,7 @@ function MyInput({placeholder, ref}) {
410410

411411
<Note>
412412

413-
<<<<<<< HEAD
414-
在类组件中,`ref` 不作为 props 传递,因为它们引用的是组件实例。这意味着,如果你在类组件中需要访问 `ref`,你需要使用 `React.forwardRef` 或者 `React.createRef`
415-
=======
416-
`ref`s passed to classes are not passed as props since they reference the component instance.
417-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91
413+
在类组件中,`ref` 不作为 props 传递,因为它们引用的是组件实例。
418414

419415
</Note>
420416

src/content/learn/preserving-and-resetting-state.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -676,11 +676,7 @@ label {
676676

677677
</Sandpack>
678678

679-
<<<<<<< HEAD
680-
当你勾选复选框后计数器的 state 被重置了。虽然你渲染了一个 `Counter`,但是 `div` 的第一个子组件从 `div` 变成了 `section`。当子组件 `div` 从 DOM 中被移除的时候,它底下的整棵树(包含 `Counter` 以及它的 state)也都被销毁了。
681-
=======
682-
The counter state gets reset when you click the checkbox. Although you render a `Counter`, the first child of the `div` changes from a `section` to a `div`. When the child `section` was removed from the DOM, the whole tree below it (including the `Counter` and its state) was destroyed as well.
683-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91
679+
当你勾选复选框后计数器的 state 被重置了。虽然你渲染了一个 `Counter`,但是 `div` 的第一个子组件从 `section` 变成了 `div`。当子组件 `section` 从 DOM 中被移除的时候,它底下的整棵树(包含 `Counter` 以及它的 state)也都被销毁了。
684680

685681
<DiagramGroup>
686682

src/content/learn/referencing-values-with-refs.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -467,11 +467,7 @@ export default function Toggle() {
467467

468468
#### 修复防抖 {/*fix-debouncing*/}
469469

470-
<<<<<<< HEAD
471-
在这个例子中,所有按钮点击处理器都是 ["防抖的"](https://redd.one/blog/debounce-vs-throttle)。 要了解这意味着什么,请按下其中一个按钮。注意消息在一秒后显示。如果你在等待消息时按下按钮,计时器将重置。因此如果你多次快速单击同一个按钮,则直到你停止单击 **之后** 1 秒钟,该消息才会显示。防抖可以让你将一些动作推迟到用户“停止动作”之后。
472-
=======
473-
In this example, all button click handlers are ["debounced".](https://kettanaito.com/blog/debounce-vs-throttle) To see what this means, press one of the buttons. Notice how the message appears a second later. If you press the button while waiting for the message, the timer will reset. So if you keep clicking the same button fast many times, the message won't appear until a second *after* you stop clicking. Debouncing lets you delay some action until the user "stops doing things".
474-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91
470+
在这个例子中,所有按钮点击处理器都是 ["防抖的"](https://kettanaito.com/blog/debounce-vs-throttle)。 要了解这意味着什么,请按下其中一个按钮。注意消息在一秒后显示。如果你在等待消息时按下按钮,计时器将重置。因此如果你多次快速单击同一个按钮,则直到你停止单击 **之后** 1 秒钟,该消息才会显示。防抖可以让你将一些动作推迟到用户“停止动作”之后。
475471

476472
这个例子可以正常运行,但并不完全符合预期。按钮不是独立的。要查看问题,请单击其中一个按钮,然后立即单击另一个按钮。你本来期望在延迟之后,你会看到两个按钮的消息。但只有最后一个按钮的消息出现了。第一个按钮的消息丢失了。
477473

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,7 @@ export default function ModalContent({ onClose }) {
240240
241241
使用 portal 时,确保应用程序的无障碍性非常重要。例如,你可能需要管理键盘焦点,以便用户可以自然进出 portal。
242242
243-
<<<<<<< HEAD
244-
创建模态对话框时,请遵循 [WAI-ARIA 模态实践指南](https://www.w3.org/WAI/ARIA/apg/#dialog_modal)。如果你使用了社区包,请确保它具有无障碍性,并遵循这些指南。
245-
=======
246-
Follow the [WAI-ARIA Modal Authoring Practices](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal) when creating modals. If you use a community package, ensure that it is accessible and follows these guidelines.
247-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91
243+
创建模态对话框时,请遵循 [WAI-ARIA 模态实践指南](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal)。如果你使用了社区包,请确保它具有无障碍性,并遵循这些指南。
248244
249245
</Pitfall>
250246

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -318,13 +318,6 @@ async function renderToString() {
318318
319319
### 我的流要等到整个应用渲染完成后才会启动。 {/*my-stream-doesnt-start-until-the-entire-app-is-rendered*/}
320320
321-
<<<<<<< HEAD
322321
`prerender` 的响应会等待整个应用渲染完成,包括所有 Suspense 边界的内容加载完成后,才会解析。这种设计适用于静态站点生成(SSG),并不支持在内容加载时进行流式加载。
323322
324323
如果需要在内容加载时进行流式加载,可以使用类似 [renderToReadableStream](/reference/react-dom/server/renderToReadableStream) 的流式服务器渲染 API。
325-
326-
=======
327-
The `prerender` response waits for the entire app to finish rendering, including waiting for all Suspense boundaries to resolve, before resolving. It is designed for static site generation (SSG) ahead of time and does not support streaming more content as it loads.
328-
329-
To stream content as it loads, use a streaming server render API like [renderToReadableStream](/reference/react-dom/server/renderToReadableStream).
330-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91

src/content/reference/react/apis.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,11 @@ translators:
1313

1414
---
1515

16-
<<<<<<< HEAD
1716
* [`createContext`](/reference/react/createContext) API 可以创建一个 context,你可以将其提供给子组件,通常会与 [`useContext`](/reference/react/useContext) 一起配合使用。
18-
* [`forwardRef`](/reference/react/forwardRef) 允许组件将 DOM 节点作为 ref 暴露给父组件。
1917
* [`lazy`](/reference/react/lazy) 允许你延迟加载组件,直到该组件需要第一次被渲染。
2018
* [`memo`](/reference/react/memo) 允许你在 props 没有变化的情况下跳过组件的重渲染。通常 [`useMemo`](/reference/react/useMemo)[`useCallback`](/reference/react/useCallback) 会一起配合使用。
2119
* [`startTransition`](/reference/react/startTransition) 允许你可以标记一个状态更新是不紧急的。类似于 [`useTransition`](/reference/react/useTransition)
2220
* [`act`](/reference/react/act) 允许你在测试中包装渲染和交互,以确保在断言之前已完成更新。
23-
=======
24-
* [`createContext`](/reference/react/createContext) lets you define and provide context to the child components. Used with [`useContext`.](/reference/react/useContext)
25-
* [`lazy`](/reference/react/lazy) lets you defer loading a component's code until it's rendered for the first time.
26-
* [`memo`](/reference/react/memo) lets your component skip re-renders with same props. Used with [`useMemo`](/reference/react/useMemo) and [`useCallback`.](/reference/react/useCallback)
27-
* [`startTransition`](/reference/react/startTransition) lets you mark a state update as non-urgent. Similar to [`useTransition`.](/reference/react/useTransition)
28-
* [`act`](/reference/react/act) lets you wrap renders and interactions in tests to ensure updates have processed before making assertions.
29-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91
3021

3122
---
3223

src/content/reference/react/createContext.md

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,11 @@ const ThemeContext = createContext('light');
3838

3939
`createContext` 返回一个上下文对象。
4040

41-
<<<<<<< HEAD
42-
**该上下文对象本身不包含任何信息**。它只表示其他组件读取或提供的那个上下文。一般来说,在组件上方使用 [`SomeContext.Provider`](#provider) 指定上下文的值,并在被包裹的下方组件内调用 [`useContext(SomeContext)`](/reference/react/useContext) 读取它。上下文对象有一些属性:
41+
**该上下文对象本身不包含任何信息**。它只表示其他组件读取或提供的那个上下文。一般来说,在组件上方使用 [`SomeContext`](#provider) 指定上下文的值,并在被包裹的下方组件内调用 [`useContext(SomeContext)`](/reference/react/useContext) 读取它。上下文对象有一些属性:
4342

44-
* `SomeContext.Provider` 让你为被它包裹的组件提供上下文的值
43+
* `SomeContext` 为组件提供上下文的值
4544
* `SomeContext.Consumer` 是一个很少会用到的备选方案,它用于读取上下文的值。
46-
=======
47-
**The context object itself does not hold any information.** It represents _which_ context other components read or provide. Typically, you will use [`SomeContext`](#provider) in components above to specify the context value, and call [`useContext(SomeContext)`](/reference/react/useContext) in components below to read it. The context object has a few properties:
48-
49-
* `SomeContext` lets you provide the context value to components.
50-
* `SomeContext.Consumer` is an alternative and rarely used way to read the context value.
51-
* `SomeContext.Provider` is a legacy way to provide the context value before React 19.
52-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91
45+
* `SomeContext.Provider` 是在 React 19 之前提供上下文值的遗留方法。
5346

5447
---
5548

@@ -71,9 +64,9 @@ function App() {
7164

7265
<Note>
7366

74-
Starting in React 19, you can render `<SomeContext>` as a provider.
67+
React 19 开始,你可以将 `<SomeContext>` 作为渲染的上下文 provider
7568

76-
In older versions of React, use `<SomeContext.Provider>`.
69+
较旧版本的 React 需要使用 `<SomeContext.Provider>`
7770

7871
</Note>
7972

@@ -229,9 +222,5 @@ const ThemeContext = createContext('light');
229222

230223
该值永远不会发生改变。当 React 无法找到匹配的 provider 时,该值会被作为后备方案。
231224

232-
<<<<<<< HEAD
233225
要想使上下文的值随时间变化,[添加状态并使用一个上下文 provider 包裹组件](/reference/react/useContext#updating-data-passed-via-context)
234226

235-
=======
236-
To make context change over time, [add state and wrap components in a context provider.](/reference/react/useContext#updating-data-passed-via-context)
237-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91

src/content/reference/react/legacy.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,9 @@ title: "过时的 React API"
2727

2828
这些 API 在 React 19 中被移除。
2929

30-
<<<<<<< HEAD
3130
* [`createFactory`](https://18.react.dev/reference/react/createFactory):使用 JSX 来替代。
3231
* 类组件:[`static contextTypes`](https://18.react.dev//reference/react/Component#static-contexttypes): 使用 [`static contextType`](#static-contexttype) 来替代。
3332
* 类组件:[`static childContextTypes`](https://18.react.dev//reference/react/Component#static-childcontexttypes): 使用 [`static contextType`](#static-contexttype) 来替代。
34-
* 类组件:[`static getChildContext`](https://18.react.dev//reference/react/Component#getchildcontext): 使用 [`Context.Provider`](/reference/react/createContext#provider) 来替代。
33+
* 类组件:[`static getChildContext`](https://18.react.dev//reference/react/Component#getchildcontext): 使用 [`Context`](/reference/react/createContext#provider) 来替代。
3534
* 类组件:[`static propTypes`](https://18.react.dev//reference/react/Component#static-proptypes): 使用 [TypeScript](https://www.typescriptlang.org/) 等类型系统来替代。
3635
* 类组件:[`this.refs`](https://18.react.dev//reference/react/Component#refs): 使用 [`createRef`](/reference/react/createRef) 来替代。
37-
=======
38-
* [`createFactory`](https://18.react.dev/reference/react/createFactory): use JSX instead.
39-
* Class Components: [`static contextTypes`](https://18.react.dev//reference/react/Component#static-contexttypes): use [`static contextType`](#static-contexttype) instead.
40-
* Class Components: [`static childContextTypes`](https://18.react.dev//reference/react/Component#static-childcontexttypes): use [`static contextType`](#static-contexttype) instead.
41-
* Class Components: [`static getChildContext`](https://18.react.dev//reference/react/Component#getchildcontext): use [`Context`](/reference/react/createContext#provider) instead.
42-
* Class Components: [`static propTypes`](https://18.react.dev//reference/react/Component#static-proptypes): use a type system like [TypeScript](https://www.typescriptlang.org/) instead.
43-
* Class Components: [`this.refs`](https://18.react.dev//reference/react/Component#refs): use [`createRef`](/reference/react/createRef) instead.
44-
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91

0 commit comments

Comments
 (0)