Skip to content

Commit

Permalink
Update reference-react-component.md
Browse files Browse the repository at this point in the history
  • Loading branch information
zaoren committed Dec 10, 2021
1 parent 44528e2 commit be29a73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/docs/reference-react-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ constructor(props) {
componentDidMount()
```

`componentDidMount()` 会在组件挂载后(插入 DOM 树中)立即调用。依赖于 DOM 节点的初始化应该放在这里。如需通过网络请求获取数据,此处是实例化请求的好地方。
`componentDidMount()` 会在组件挂载后(在他自己的容器中渲染渲染完成了,并不代表已经渲染到DOM树)立即调用。依赖于 DOM 节点的初始化应该放在这里。如需通过网络请求获取数据,此处是实例化请求的好地方。

这个方法是比较适合添加订阅的地方。如果添加了订阅,请不要忘记在 `componentWillUnmount()` 里取消订阅

Expand Down

0 comments on commit be29a73

Please sign in to comment.