We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07a12a4 commit 9dc6aa6Copy full SHA for 9dc6aa6
content/docs/hooks-overview.md
@@ -6,7 +6,7 @@ next: hooks-state.html
6
prev: hooks-intro.html
7
---
8
9
-*Hook* 是 React 16.8 的新增特性。它可以让你在不使用 class 的情况下使用 state 和一些其他的 React 特性。
+*Hook* 是 React 16.8 的新增特性。它可以让你在不编写 class 的情况下使用 state 以及其他的 React 特性。
10
11
Hook 是[向下兼容的](/docs/hooks-intro.html#no-breaking-changes)。本页面为有经验的 React 用户提供一个对 Hook 的概览。这是一个相当快速的概览,如果你有疑惑,可以参阅下面这样的黄色提示框。
12
@@ -201,10 +201,11 @@ function useFriendStatus(friendID) {
201
}
202
```
203
204
-它将 `friendID` 作为参数,并返回该好友是否在线。
+它将 `friendID` 作为参数,并返回该好友是否在线:
205
206
现在我们可以在两个组件中使用它:
207
208
+
209
```js{2}
210
function FriendStatus(props) {
211
const isOnline = useFriendStatus(props.friend.id);
0 commit comments