Skip to content

Commit 6f225cc

Browse files
merging all conflicts
2 parents 0cdf749 + b7bf6c1 commit 6f225cc

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"webpack-bundle-analyzer": "^4.5.0"
9999
},
100100
"engines": {
101-
"node": "^16.8.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0"
101+
"node": ">=16.8.0"
102102
},
103103
"nextBundleAnalysis": {
104104
"budget": null,

src/content/learn/synchronizing-with-effects.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,15 @@ title: '使用 Effect 同步'
4545

4646
编写 Effect 需要遵循以下三个规则:
4747

48+
<<<<<<< HEAD
4849
1. **声明 Effect**。默认情况下,Effect 会在每次渲染后都会执行。
4950
2. **指定 Effect 依赖**。大多数 Effect 应该按需执行,而不是在每次渲染后都执行。例如,淡入动画应该只在组件出现时触发。连接和断开服务器的操作只应在组件出现和消失时,或者切换聊天室时执行。文章将介绍如何通过指定依赖来控制如何按需执行。
5051
3. **必要时添加清理(cleanup)函数**。有时 Effect 需要指定如何停止、撤销,或者清除它的效果。例如,“连接”操作需要“断连”,“订阅”需要“退订”,“获取”既需要“取消”也需要“忽略”。你将学习如何使用 **清理函数** 来做到这一切。
52+
=======
53+
1. **Declare an Effect.** By default, your Effect will run after every [commit](/learn/render-and-commit).
54+
2. **Specify the Effect dependencies.** Most Effects should only re-run *when needed* rather than after every render. For example, a fade-in animation should only trigger when a component appears. Connecting and disconnecting to a chat room should only happen when the component appears and disappears, or when the chat room changes. You will learn how to control this by specifying *dependencies.*
55+
3. **Add cleanup if needed.** Some Effects need to specify how to stop, undo, or clean up whatever they were doing. For example, "connect" needs "disconnect", "subscribe" needs "unsubscribe", and "fetch" needs either "cancel" or "ignore". You will learn how to do this by returning a *cleanup function*.
56+
>>>>>>> b7bf6c16fb3152626a71c115b3242df6eb93bc6e
5157
5258
以下是具体步骤。
5359

src/content/learn/tutorial-tic-tac-toe.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2915,4 +2915,8 @@ body {
29152915
1. 当有人获胜时,突出显示致使获胜的三个方块(当没有人获胜时,显示一条关于结果为平局的消息)。
29162916
1. 在“落子”的历史列表中以 (row, col) 格式显示每步的位置。
29172917
2918+
<<<<<<< HEAD
29182919
在本教程中,你已经接触到了 React 概念,包括元素、组件、props 和 state。现在你已经了解了这些概念在构建游戏时是如何工作的,请查看 [React 哲学](/learn/thinking-in-react) 以了解这些 React 概念在构建应用的 UI 时是如何工作的。
2920+
=======
2921+
Throughout this tutorial, you've touched on React concepts including elements, components, props, and state. Now that you've seen how these concepts work when building a game, check out [Thinking in React](/learn/thinking-in-react) to see how the same React concepts work when building an app's UI.
2922+
>>>>>>> b7bf6c16fb3152626a71c115b3242df6eb93bc6e

src/content/reference/react-dom/components/form.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ export async function signUpNewUser(newEmail) {
386386

387387
</Sandpack>
388388

389-
Learn more about updating state from a form action with the [`useActionState`](/reference/react/hooks/useActionState) docs
389+
Learn more about updating state from a form action with the [`useActionState`](/reference/react/useActionState) docs
390390

391391
### Handling multiple submission types {/*handling-multiple-submission-types*/}
392392

0 commit comments

Comments
 (0)