Skip to content

Commit

Permalink
translate: update omissions
Browse files Browse the repository at this point in the history
  • Loading branch information
thehelium committed Mar 26, 2023
1 parent e04d188 commit 875d1a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/content/reference/react/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ title: "内置 React Hook"

## 状态 Hook {/*state-hooks*/}

*State* 让一个组件 ["记住" 像用户输入的信息](/learn/state-a-components-memory),比如,要给一个组件添加状态,使用这些 Hook 中的一个:
*State* 让一个组件 ["记住" 像用户输入的信息](/learn/state-a-components-memory),比如,一个表单组件可以使用状态来存储输入值,而一个图片库组件可以使用状态来存储选定的图片索引。

要给一个组件添加状态,使用这些 Hook 中的一个:

* [`useState`](/reference/react/useState) 声明了一个你可以直接更新的状态变量。
* [`useReducer`](/reference/react/useReducer) 声明了一个带有更新逻辑的状态变量在一个 [reducer 函数](/learn/extracting-state-logic-into-a-reducer)中。
Expand Down

0 comments on commit 875d1a3

Please sign in to comment.