Skip to content

Commit

Permalink
docs(cn): modify related complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
yixiaojiu committed Jun 25, 2023
1 parent 8d2baba commit 9c258ff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/content/reference/react/PureComponent.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ title: PureComponent

<Pitfall>

我们建议将组件定义为函数而不是类[查看如何迁移](#alternatives)
我们建议使用函数式组件而非类式组件[查看如何迁移](#alternatives)

</Pitfall>

<Intro>

`PureComponent` 类似于 [`Component`](/reference/react/Component)但是它会跳过 props 和 state 的重新渲染。React 仍然支持类组件,但我们不建议在新代码中使用它们。
`PureComponent` 类似于 [`Component`](/reference/react/Component)但是当 props 和 state 与之前保持一致时会跳过重新渲染。React 仍然支持类式组件,但我们不建议在新代码中使用它们。

```js
class Greeting extends PureComponent {
Expand Down Expand Up @@ -109,7 +109,7 @@ label {

<Pitfall>

我们建议将组件定义为函数而不是类[查看如何迁移](#alternatives)
我们建议使用函数式组件而非类式组件[查看如何迁移](#alternatives)

</Pitfall>

Expand Down

0 comments on commit 9c258ff

Please sign in to comment.