Skip to content

Commit

Permalink
Update strict-mode.md
Browse files Browse the repository at this point in the history
  • Loading branch information
QC-L authored Apr 13, 2019
1 parent fd67c7c commit 1374d39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/docs/strict-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class MyComponent extends React.Component {
* `render`
* `setState` 更新函数(第一个参数)

因为上述方法可能会被多次调用,所以不要在它们内部编写副作用相关的代码,这点非常重要。忽略此规则可能会导致各种问题的产生,包括内存泄漏和或出现无效的应用程序状态。不幸的是,这些问题很难被发现,因为它们通常都是[非确定性](https://en.wikipedia.org/wiki/Deterministic_algorithm)
因为上述方法可能会被多次调用,所以不要在它们内部编写副作用相关的代码,这点非常重要。忽略此规则可能会导致各种问题的产生,包括内存泄漏和或出现无效的应用程序状态。不幸的是,这些问题很难被发现,因为它们通常具有[非确定性](https://en.wikipedia.org/wiki/Deterministic_algorithm)

严格模式不能自动检测到你的副作用,但它可以帮助你发现它们,使它们更具确定性。通过故意重复调用以下方法来实现的该操作:

Expand Down

0 comments on commit 1374d39

Please sign in to comment.