Skip to content

Commit

Permalink
docs: 补充 Taro.memo 的版本支持度
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche committed Jun 3, 2019
1 parent bbf7e6e commit d935052
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/optimized-practice.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ shouldComponentUpdate (nextProps, nextState) {

### Taro.memo

> 自 v1.3.0 可用
`Taro.memo` 是一个高阶组件,它和 `PureComponent` 非常相似。但它适用于函数式组件,而非 Class 组件。

如果你的函数组件在给定相同 props 的情况下渲染相同的结果,那么你可以通过将其包装在 Taro.memo 中调用,以此通过记忆组件渲染结果的方式来提高组件的性能表现。这意味着在这种情况下,Taro 将跳过渲染组件的操作并直接复用最近一次渲染的结果。
Expand Down

0 comments on commit d935052

Please sign in to comment.