Skip to content

Commit fe84245

Browse files
authored
Merge branch 'reactjs:main' into translate/hoc
2 parents 546743d + ad02e1f commit fe84245

File tree

3 files changed

+38
-35
lines changed

3 files changed

+38
-35
lines changed

content/community/support.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,28 @@ redirect_from:
88
- "support.html"
99
---
1010

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.
1212

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.
1414

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.
1616

1717
## Stack Overflow {#stack-overflow}
1818

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)!
2020

21-
## Popular Discussion Forums {#popular-discussion-forums}
21+
## Diễn đàn thảo luận phổ biến {#popular-discussion-forums}
2222

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.
2424

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.
2626

27-
* [DEV's React community](https://dev.to/t/react)
28-
* [Hashnode's React community](https://hashnode.com/n/reactjs)
29-
* [Reactiflux online chat](https://discord.gg/reactiflux)
30-
* [Reddit's React community](https://www.reddit.com/r/reactjs/)
31-
* [Spectrum's React community](https://spectrum.chat/react)
27+
* [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)
3232

33-
## News {#news}
33+
## Tin tức {#news}
3434

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) [blog chính thức của React](/blog/) trên trang này.

content/docs/addons-pure-render-mixin.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ layout: docs
66
category: Add-Ons
77
---
88

9-
> Note:
9+
> Lưu ý:
1010
>
11-
> `PureRenderMixin` is a legacy add-on. Use [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) instead.
11+
> `PureRenderMixin` được kế thừa từ add-on. Sử dụng [`React.PureComponent`](/docs/react-api.html#reactpurecomponent) thay thế.
1212
1313
**Importing**
1414

1515
```javascript
1616
import PureRenderMixin from 'react-addons-pure-render-mixin'; // ES6
17-
var PureRenderMixin = require('react-addons-pure-render-mixin'); // ES5 with npm
17+
var PureRenderMixin = require('react-addons-pure-render-mixin'); // ES5 với npm
1818
```
1919

20-
## Overview {#overview}
20+
## Tổng quát {#overview}
2121

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.
2323

24-
Example:
24+
Ví dụ:
2525

2626
```js
2727
const createReactClass = require('create-react-class');
@@ -35,10 +35,10 @@ createReactClass({
3535
});
3636
```
3737

38-
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.
3939

40-
> Note:
40+
> Lưu ý:
4141
>
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.
4343
>
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".

content/docs/addons-shallow-compare.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,26 @@ layout: docs
66
category: Reference
77
---
88

9-
> Note:
9+
> Lưu ý:
1010
>
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ế.
1212
1313
**Importing**
1414

1515
```javascript
1616
import shallowCompare from 'react-addons-shallow-compare'; // ES6
17-
var shallowCompare = require('react-addons-shallow-compare'); // ES5 with npm
17+
var shallowCompare = require('react-addons-shallow-compare'); // ES5 với npm
1818
```
1919

20-
## Overview {#overview}
20+
## Tổng quát {#overview}
2121

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.
2322

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.
2524

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.
26+
27+
28+
Ví dụ:
2729

2830
```js
2931
export class SampleComponent extends React.Component {
@@ -37,8 +39,9 @@ export class SampleComponent extends React.Component {
3739
}
3840
```
3941

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``nextProps` hiện tại cũng như các đối tượng `state``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.
4247

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

Comments
 (0)