Skip to content

Commit c00817d

Browse files
committed
docs(cn): fix conflicts
1 parent 7ba5a7e commit c00817d

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

beta/src/pages/learn/extracting-state-logic-into-a-reducer.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ translators:
2323

2424
## 使用 reducer 整合状态逻辑 {/*consolidate-state-logic-with-a-reducer*/}
2525

26-
<<<<<<< HEAD
27-
随着组件复杂度的增加,你将很难一眼看清所有的组件状态更新逻辑。例如,下面的 `TaskBoard` 组件有一个数组类型的状态 `tasks`,并通过三个不同的事件处理程序来实现任务的添加、删除和修改:
28-
=======
29-
As your components grow in complexity, it can get harder to see all the different ways that a component's state gets updated at a glance. For example, the `TaskApp` component below holds an array of `tasks` in state and uses three different event handlers to add, remove, and edit tasks:
30-
>>>>>>> eb0ae240c3e99e6bdd658fc490dd767699b124d1
26+
随着组件复杂度的增加,你将很难一眼看清所有的组件状态更新逻辑。例如,下面的 `TaskApp` 组件有一个数组类型的状态 `tasks`,并通过三个不同的事件处理程序来实现任务的添加、删除和修改:
3127

3228
<Sandpack>
3329

@@ -232,11 +228,7 @@ function handleDeleteTask(taskId) {
232228
* `handleChangeTask(task)` 在用户切换任务或点击 “保存” 时被调用。
233229
* `handleDeleteTask(taskId)` 在用户点击 “删除” 时被调用。
234230

235-
<<<<<<< HEAD
236231
使用 reducers 管理状态与直接设置状态略有不同。它不是通过设置状态来告诉 React “要做什么”,而是通过事件处理程序 dispatch 一个 “action” 来指明 “用户刚刚做了什么”。(而状态更新逻辑则保存在其他地方!)因此,我们不再通过事件处理器直接“设置任务”,而是 dispatch 一个 “添加/修改/删除任务” 的 action。这更加符合用户的思维。
237-
=======
238-
Managing state with reducers is slightly different from directly setting state. Instead of telling React "what to do" by setting state, you specify "what the user just did" by dispatching "actions" from your event handlers. (The state update logic will live elsewhere!) So instead of "setting `tasks`" via event handler, you're dispatching an "added/changed/deleted a task" action. This is more descriptive of the user's intent.
239-
>>>>>>> eb0ae240c3e99e6bdd658fc490dd767699b124d1
240232

241233
```js
242234
function handleAddTask(text) {

content/community/courses.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,7 @@ permalink: community/courses.html
4747

4848
- [React Training: 高级 React.js](https://courses.reacttraining.com/p/advanced-react) - 将你的 React 水平提高到一个新的 level。
4949

50-
<<<<<<< HEAD
51-
- [Tyler McGinnis](https://tylermcginnis.com/courses) - Tyler McGinnis 以月费的方式提供他课程的使用权。课程包括 "React 基础知识" 和 "通用的 React".
52-
=======
53-
- [Tyler McGinnis](https://ui.dev/) - Tyler McGinnis provides access to his courses for a monthly fee. Courses include "React Fundamentals" and "Universal React".
54-
>>>>>>> eb0ae240c3e99e6bdd658fc490dd767699b124d1
50+
- [Tyler McGinnis](https://ui.dev/) - Tyler McGinnis 以月费的方式提供他课程的使用权。课程包括 "React 基础知识" 和 "通用的 React".
5551

5652
- [Mastering React](https://codewithmosh.com/p/mastering-react/) - 用 React 构建专业的交互式应用程序。
5753

0 commit comments

Comments
 (0)