Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0d1b17d

Browse files
author
我和胖虎五五开
committedMar 19, 2019
fix
1 parent 9fd809c commit 0d1b17d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎content/docs/reference-react-component.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Welcome extends React.Component {
3939
4040
### 组件的生命周期 {#the-component-lifecycle}
4141

42-
每个组件都包含“生命周期方法”,你可以重写这些方法,以便于在运行过程中特定的阶段执行这些方法。你可以使用此[生命周期图谱](http://projects.wojtekmaj.pl/react-lifecycle-methods-diagram/)作为速查表。在下述列表中,常用的生命周期方法会被加粗。其余生命周期函数的使用则相对罕见。
42+
每个组件都包含“生命周期方法”,你可以重写这些方法,以便于在运行过程中特定的阶段执行这些方法。**你可以使用此[生命周期图谱](http://projects.wojtekmaj.pl/react-lifecycle-methods-diagram/)作为速查表**。在下述列表中,常用的生命周期方法会被加粗。其余生命周期函数的使用则相对罕见。
4343

4444
#### 挂载 {#mounting}
4545

@@ -163,7 +163,7 @@ constructor(props) {
163163
}
164164
```
165165

166-
只能在构造函数中为 `this.state` 赋值。如需在其他方法中赋值,你应使用 `this.setState()` 替代。
166+
只能在构造函数中直接为 `this.state` 赋值。如需在其他方法中赋值,你应使用 `this.setState()` 替代。
167167

168168
要避免在构造函数中引入任何副作用或订阅。如遇到此场景,请将对应的操作放置在 `componentDidMount` 中。
169169

0 commit comments

Comments
 (0)
Please sign in to comment.