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/community/support.md
+14-14Lines changed: 14 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -8,28 +8,28 @@ redirect_from:
8
8
- "support.html"
9
9
---
10
10
11
-
React has a community of millions of developers.
11
+
React có một cộng đồng hàng triệu lập trình viên.
12
12
13
-
On this page we've listed some React-related communities that you can be a part of; see the other pages in this section for additional online and in-person learning materials.
13
+
Trên trang này chúng tôi đã liệt kê ra một số cộng đồng liên quan đến React mà bạn có thể tham gia; xem các trang khác trong phần này để biết thêm tài liệu học online và trực tiếp.
14
14
15
-
Before participating in React's communities, [please read our Code of Conduct](https://github.com/facebook/react/blob/main/CODE_OF_CONDUCT.md). We have adopted the [Contributor Covenant](https://www.contributor-covenant.org/)and we expect that all community members adhere to the guidelines within.
15
+
Trước khi tham gia vào cộng đồng React, [vui lòng đọc Quy tắc ứng xử của chúng tôi](https://github.com/facebook/react/blob/main/CODE_OF_CONDUCT.md). Chúng tôi đã áp dụng [Giao ước cộng tác viên](https://www.contributor-covenant.org/)và chúng tôi hi vọng các thành viên trong cộng đồng sẽ tuân thủ các qui tắc.
16
16
17
17
## Stack Overflow {#stack-overflow}
18
18
19
-
Stack Overflow is a popular forum to ask code-level questions or if you're stuck with a specific error. Read through the [existing questions](https://stackoverflow.com/questions/tagged/reactjs)tagged with **reactjs**or [ask your own](https://stackoverflow.com/questions/ask?tags=reactjs)!
19
+
Stack Overflow là một diễn đàn nổi tiếng để đặt các câu hỏi về code hoặc nếu bạn gặp một lỗi cụ thể. Đọc qua [câu hỏi hiện có](https://stackoverflow.com/questions/tagged/reactjs)được gắn thẻ **reactjs**hoặc [câu hỏi của riêng bạn](https://stackoverflow.com/questions/ask?tags=reactjs)!
20
20
21
-
## Popular Discussion Forums {#popular-discussion-forums}
21
+
## Diễn đàn thảo luận phổ biến {#popular-discussion-forums}
22
22
23
-
There are many online forums which are a great place for discussion about best practices and application architecture as well as the future of React. If you have an answerable code-level question, Stack Overflow is usually a better fit.
23
+
Có rất nhiều diễn đàn online là nơi tuyệt vời để thảo luận về phương pháp hay nhất và kiến trúc ứng dụng cũng như tương lai của React. Nếu bạn có một câu hỏi về code có thể trả lời được, Stack Overflow là một nơi phù hợp.
24
24
25
-
Each community consists of many thousands of React users.
25
+
Mỗi cộng đồng bao gồm hàng nghìn người dùng React.
*[Cộng đồng React của DEV](https://dev.to/t/react)
28
+
*[Cộng đồng React của Hashnode](https://hashnode.com/n/reactjs)
29
+
*[Trò chuyện online với Reactiflux](https://discord.gg/reactiflux)
30
+
*[Cộng đồng React của Reddit](https://www.reddit.com/r/reactjs/)
31
+
*[Cộng đồng React của Spectrum](https://spectrum.chat/react)
32
32
33
-
## News {#news}
33
+
## Tin tức {#news}
34
34
35
-
For the latest news about React, [follow **@reactjs**on Twitter](https://twitter.com/reactjs)and the [official React blog](/blog/)on this website.
35
+
Để biết thêm tin tức mới nhất về React, [theo dõi **@reactjs**trên Twitter](https://twitter.com/reactjs)và [blog chính thức của React](/blog/)trên trang này.
var PureRenderMixin =require('react-addons-pure-render-mixin'); // ES5 with npm
17
+
var PureRenderMixin =require('react-addons-pure-render-mixin'); // ES5 với npm
18
18
```
19
19
20
-
## Overview {#overview}
20
+
## Tổng quát {#overview}
21
21
22
-
If your React component's render function renders the same result given the same props and state, you can use this mixin for a performance boost in some cases.
22
+
Nếu function render của React component của bạn hiển thị cùng một kết quả với cùng prop và state, bạn có thể sử dụng mixin để tăng hiệu suất trong một số trường hợp.
Under the hood, the mixin implements [shouldComponentUpdate](/docs/component-specs.html#updating-shouldcomponentupdate), in which it compares the current props and state with the next ones and returns `false`if the equalities pass.
38
+
Xem xét một cách kỹ lưỡng, mixin thực hiện [shouldComponentUpdate](/docs/component-specs.html#updating-shouldcomponentupdate), trong đó nó so sánh prop và state hiện tại với những cái tiếp theo và trả về `false`nếu chúng bằng nhau.
39
39
40
-
> Note:
40
+
> Lưu ý:
41
41
>
42
-
> This only shallowly compares the objects. If these contain complex data structures, it may produce false-negatives for deeper differences. Only mix into components which have simple props and state, or use`forceUpdate()`when you know deep data structures have changed. Or, consider using [immutable objects](https://facebook.github.io/immutable-js/)to facilitate fast comparisons of nested data.
42
+
> Đây chỉ là so sánh nông với các object. Nếu object chứa cấu trúc dữ liệu phức tạp, nó có thể tạo ra các trường hợp sai đối với sự khác nhau sâu trong nhiều cấp của object. Chỉ được dùng đối với component có prop và state đơn giản, hoặc dùng`forceUpdate()`khi bạn biết cấu trúc dữ liệu sâu bên trong đã thay đổi. Có thể cân nhắc sử dụng [immutable objects](https://facebook.github.io/immutable-js/)để dễ dàng so sánh các dữ liệu lồng nhau.
43
43
>
44
-
> Furthermore, `shouldComponentUpdate`skips updates for the whole component subtree. Make sure all the children components are also "pure".
44
+
> Hơn nữa, `shouldComponentUpdate`bỏ qua cập nhật toàn bộ các component con. Hãy đảm bảo rằng tất cả các component con cũng là "pure".
Copy file name to clipboardExpand all lines: content/docs/addons-shallow-compare.md
+14-11Lines changed: 14 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -6,24 +6,26 @@ 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.
23
22
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.
23
+
Trước khi [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) được giới thiệu, `shallowCompare` thường được sử dụng có chức năng tương tự như [`PureRenderMixin`](pure-render-mixin.html) trong khi sử dụng các lớp ES6 với React.
25
24
26
-
Example:
25
+
Nếu render function của React component là "thuần" (nói một cách khác, nó trả về cùng một kết quả với cùng props và state), bạn có thể dùng helper function để tăng cường hiệu suất trong một số trường hợp.
@@ -37,8 +39,9 @@ export class SampleComponent extends React.Component {
37
39
}
38
40
```
39
41
40
-
`shallowCompare` performs a shallow equality check on the current `props` and `nextProps` objects as well as the current `state` and `nextState` objects.
41
-
It does this by iterating on the keys of the objects being compared and returning true when the values of a key in each object are not strictly equal.
42
+
`shallowCompare` thực hiện kiểm tra shallow equality ở các đối tượng `props` và `nextProps` hiện tại cũng như các đối tượng `state` và `nextState` hiện tại. Nó thực hiện điều này bằng cách thực hiện lặp đi lặp lại trên các khóa của đối tượng được so sánh và trả về true khi các giá trị của khóa ở mỗi đối tượng không hoàn toàn bằng nhau.
43
+
44
+
`shallowCompare` trả về `true` nếu phép so sánh shallow cho props hoặc state thất bại và component sẽ được cập nhật.
45
+
46
+
`shallowCompare` trả về `false` nếu phép so sánh shallow cho props hoặc state thành công và component không cần cập nhật.
42
47
43
-
`shallowCompare` returns `true` if the shallow comparison for props or state fails and therefore the component should update.
44
-
`shallowCompare` returns `false` if the shallow comparison for props and state both pass and therefore the component does not need to update.
0 commit comments