You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/addons-shallow-compare.md
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -6,24 +6,24 @@ layout: docs
6
6
category: Reference
7
7
---
8
8
9
-
> Note:
9
+
> Lưu ý:
10
10
>
11
-
> `shallowCompare`is a legacy add-on. Use [`React.memo`](/docs/react-api.html#reactmemo)or[`React.PureComponent`](/docs/react-api.html#reactpurecomponent)instead.
11
+
> `shallowCompare`được kế thừa từ add-on. Sử dụng [`React.memo`](/docs/react-api.html#reactmemo)hoặc[`React.PureComponent`](/docs/react-api.html#reactpurecomponent)thay thế.
var shallowCompare =require('react-addons-shallow-compare'); // ES5 with npm
17
+
var shallowCompare =require('react-addons-shallow-compare'); // ES5 với npm
18
18
```
19
19
20
-
## Overview {#overview}
20
+
## Tổng quát {#overview}
21
21
22
-
Before [`React.PureComponent`](/docs/react-api.html#reactpurecomponent)was introduced, `shallowCompare`was commonly used to achieve the same functionality as [`PureRenderMixin`](pure-render-mixin.html)while using ES6 classes with React.
22
+
Trước đây [`React.PureComponent`](/docs/react-api.html#reactpurecomponent)đã được giới thiệu, `shallowCompare`thường được sử dụng với chức năng tương tự như [`PureRenderMixin`](pure-render-mixin.html)khi sử dụng ES6 class với React.
23
23
24
-
If your React component's render function is "pure" (in other words, it renders the same result given the same props and state), you can use this helper function for a performance boost in some cases.
24
+
Nếu function render của React component của bạn là "pure" (hay nói cách khác, nó render cùng một kết quả với cùng prop và state), bạn có thể sử dụng helper function này để tăng hiệu suất trong một số trường hợp.
0 commit comments