Skip to content

Commit ddab33d

Browse files
merging all conflicts
2 parents 21bc3bf + 68e4efc commit ddab33d

File tree

8 files changed

+62
-41
lines changed

8 files changed

+62
-41
lines changed

content/docs/concurrent-mode-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ For more information on Concurrent Mode, check out the [Concurrent Mode document
5959

6060
`Suspense` lets your components "wait" for something before they can render, showing a fallback while waiting.
6161

62-
In this example, `ProfileDetails` is waiting for an asynchronous API call to fetch some data. While we wait for `ProfileDetails` and `ProfilePhoto`, we will show the `Loading...` fallback instead. It is important to note that until all children inside `<Suspense>` has loaded, we will continue to show the fallback.
62+
In this example, `ProfileDetails` is waiting for an asynchronous API call to fetch some data. While we wait for `ProfileDetails` and `ProfilePhoto`, we will show the `Loading...` fallback instead. It is important to note that until all children inside `<Suspense>` have loaded, we will continue to show the fallback.
6363

6464
`Suspense` takes two props:
6565
* **fallback** takes a loading indicator. The fallback is shown until all of the children of the `Suspense` component have finished rendering.

content/docs/forms.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ redirect_from:
99
- "docs/forms-zh-CN.html"
1010
---
1111

12+
<<<<<<< HEAD
1213
Trong React, HTML form element sẽ hoạt động hơi khác một chút so với các DOM element còn lại, form element sẽ giữ và tự xử lí một số state nội bộ (internal state) của riêng nó. Ví dụ như form dưới đây trong HTML sẽ nhận vào giá trị của input name.
14+
=======
15+
HTML form elements work a bit differently from other DOM elements in React, because form elements naturally keep some internal state. For example, this form in plain HTML accepts a single name:
16+
>>>>>>> 68e4efcf93b6e589355f6aa3cbc3f3c811c0ad37
1317
1418
```html
1519
<form>

content/docs/handling-events.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,31 @@ sẽ có đôi chút khác biệt trong React:
2929
</button>
3030
```
3131

32+
<<<<<<< HEAD
3233
Một điểm khác biệt nữa trong React là bạn không thể trả về `false` để chặn những hành vi mặc định mà phải gọi `preventDefault` trực tiếp. Lấy ví dụ với đoạn HTML sau, để chặn hành vi mặc định của đường dẫn là mở trang mới, bạn có thể viết:
34+
=======
35+
Another difference is that you cannot return `false` to prevent default behavior in React. You must call `preventDefault` explicitly. For example, with plain HTML, to prevent the default form behavior of submitting, you can write:
36+
>>>>>>> 68e4efcf93b6e589355f6aa3cbc3f3c811c0ad37
3337
3438
```html
35-
<a href="#" onclick="console.log('The link was clicked.'); return false">
36-
Click me
37-
</a>
39+
<form onsubmit="console.log('You clicked submit.'); return false">
40+
<button type="submit">Submit</button>
41+
</form>
3842
```
3943

4044
Còn trong React, bạn có thể làm như thế này:
4145

42-
```js{2-5,8}
43-
function ActionLink() {
44-
function handleClick(e) {
46+
```js{3}
47+
function Form() {
48+
function handleSubmit(e) {
4549
e.preventDefault();
46-
console.log('The link was clicked.');
50+
console.log('You clicked submit.');
4751
}
4852
4953
return (
50-
<a href="#" onClick={handleClick}>
51-
Click me
52-
</a>
54+
<form onSubmit={handleSubmit}>
55+
<button type="submit">Submit</button>
56+
</form>
5357
);
5458
}
5559
```
@@ -71,8 +75,8 @@ class Toggle extends React.Component {
7175
}
7276
7377
handleClick() {
74-
this.setState(state => ({
75-
isToggleOn: !state.isToggleOn
78+
this.setState(prevState => ({
79+
isToggleOn: !prevState.isToggleOn
7680
}));
7781
}
7882

content/docs/hello-world.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ React là một thư viện JavaScript, và vì thế chúng tôi giả định
4040

4141
>Ghi chú
4242
>
43+
<<<<<<< HEAD
4344
>Hướng dẫn này thỉnh thoảng sử dụng một vài cấu trúc JavaScript mới trong các ví dụ. Nếu bạn chưa từng làm việc với JavaScript trong những năm gần đây, [Ba điều này](https://gist.github.com/gaearon/683e676101005de0add59e8bb345340c) sẽ mang cho bạn kiến thức để bạn cảm thấy thoải mái hơn khi đọc các tài liệu của React.
45+
=======
46+
>This guide occasionally uses some newer JavaScript syntax in the examples. If you haven't worked with JavaScript in the last few years, [these three points](https://gist.github.com/gaearon/683e676101005de0add59e8bb345340c) should get you most of the way.
47+
>>>>>>> 68e4efcf93b6e589355f6aa3cbc3f3c811c0ad37
4448
4549

4650
## Hãy cùng bắt đầu nhé! {#lets-get-started}

content/docs/higher-order-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ The `compose` utility function is provided by many third-party libraries includi
297297

298298
## Convention: Wrap the Display Name for Easy Debugging {#convention-wrap-the-display-name-for-easy-debugging}
299299

300-
The container components created by HOCs show up in the [React Developer Tools](https://github.com/facebook/react-devtools) like any other component. To ease debugging, choose a display name that communicates that it's the result of a HOC.
300+
The container components created by HOCs show up in the [React Developer Tools](https://github.com/facebook/react/tree/master/packages/react-devtools) like any other component. To ease debugging, choose a display name that communicates that it's the result of a HOC.
301301

302302
The most common technique is to wrap the display name of the wrapped component. So if your higher-order component is named `withSubscription`, and the wrapped component's display name is `CommentList`, use the display name `WithSubscription(CommentList)`:
303303

content/docs/lists-and-keys.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,11 @@ Một nguyên tắc nhỏ đó là các element bên trong hàm gọi `map()` c
209209

210210
### Các Key Chỉ Bắt Buộc Là Duy Nhất Giữa Các Nút Anh Em (Siblings) {#keys-must-only-be-unique-among-siblings}
211211

212+
<<<<<<< HEAD
212213
Các Key được sử dụng bên trong các mảng nên là duy nhất giữa các nút anh em của chúng. Tuy nhiên chúng không cần là duy nhất đối với toàn bộ component. Chúng ta có thể sử dụng các key giống nhau khi chúng ta tạo hai mảng khác nhau:
214+
=======
215+
Keys used within arrays should be unique among their siblings. However, they don't need to be globally unique. We can use the same keys when we produce two different arrays:
216+
>>>>>>> 68e4efcf93b6e589355f6aa3cbc3f3c811c0ad37
213217
214218
```js{2,5,11,12,19,21}
215219
function Blog(props) {

content/docs/thinking-in-react.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ Có 2 kiểu "mô hình" dữ liệu trong React: props và state. Hiểu ra s
8484

8585
Để xây dựng ứng dụng của bạn một cách chuẩn xác, đầu tiên cần suy nghĩ về một tập hợp tối thiểu các state có khả năng thay đổi trong ứng dựng. Trọng điểm là [DRY: *Không lập lại*](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) Xác định tập hợp này và tính toán những yêu cầu khác. Ví dụ, bạn tạo ra một danh sách TODO, không nên dùng state để đếm phần tử của mảng TODO. Thay vào đó khi in ra số lượng TODO, chỉ cần tính độ dài của mảng TODO.
8686

87+
<<<<<<< HEAD
8788
Suy tính về các thành phần dữ liệu trong ví dụ ứng dựng, nó bao gồm:
89+
=======
90+
Think of all the pieces of data in our example application. We have:
91+
>>>>>>> 68e4efcf93b6e589355f6aa3cbc3f3c811c0ad37
8892
8993
* Danh sách gốc các sản phẩm
9094
* Từ khoá tìm kiếm từ phía người dùng

yarn.lock

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3417,14 +3417,15 @@ browserify-zlib@^0.2.0:
34173417
pako "~1.0.5"
34183418

34193419
browserslist@^4.0.0, browserslist@^4.12.0, browserslist@^4.12.2, browserslist@^4.8.5:
3420-
version "4.14.3"
3421-
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.14.3.tgz#381f9e7f13794b2eb17e1761b4f118e8ae665a53"
3422-
integrity sha512-GcZPC5+YqyPO4SFnz48/B0YaCwS47Q9iPChRGi6t7HhflKBcINzFrJvRfC+jp30sRMKxF+d4EHGs27Z0XP1NaQ==
3420+
version "4.16.6"
3421+
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2"
3422+
integrity sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==
34233423
dependencies:
3424-
caniuse-lite "^1.0.30001131"
3425-
electron-to-chromium "^1.3.570"
3426-
escalade "^3.1.0"
3427-
node-releases "^1.1.61"
3424+
caniuse-lite "^1.0.30001219"
3425+
colorette "^1.2.2"
3426+
electron-to-chromium "^1.3.723"
3427+
escalade "^3.1.1"
3428+
node-releases "^1.1.71"
34283429

34293430
buble-jsx-only@^0.19.8:
34303431
version "0.19.8"
@@ -3726,10 +3727,10 @@ caniuse-api@^3.0.0:
37263727
lodash.memoize "^4.1.2"
37273728
lodash.uniq "^4.5.0"
37283729

3729-
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001131:
3730-
version "1.0.30001135"
3731-
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001135.tgz#995b1eb94404a3c9a0d7600c113c9bb27f2cd8aa"
3732-
integrity sha512-ziNcheTGTHlu9g34EVoHQdIu5g4foc8EsxMGC7Xkokmvw0dqNtX8BS8RgCgFBaAiSp2IdjvBxNdh0ssib28eVQ==
3730+
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001219:
3731+
version "1.0.30001230"
3732+
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001230.tgz#8135c57459854b2240b57a4a6786044bdc5a9f71"
3733+
integrity sha512-5yBd5nWCBS+jWKTcHOzXwo5xzcj4ePE/yjtkZyUV1BTUmrBaA9MRGC+e7mxnqXSA90CmCA8L3eKLaSUkt099IQ==
37333734

37343735
case@^1.6.2:
37353736
version "1.6.3"
@@ -4085,10 +4086,10 @@ color@^3.0.0, color@^3.1.2:
40854086
color-convert "^1.9.1"
40864087
color-string "^1.5.2"
40874088

4088-
colorette@^1.2.1:
4089-
version "1.2.1"
4090-
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.1.tgz#4d0b921325c14faf92633086a536db6e89564b1b"
4091-
integrity sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==
4089+
colorette@^1.2.1, colorette@^1.2.2:
4090+
version "1.2.2"
4091+
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94"
4092+
integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==
40924093

40934094
colors@^1.1.2:
40944095
version "1.4.0"
@@ -5335,10 +5336,10 @@ ee-first@1.1.1:
53355336
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
53365337
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
53375338

5338-
electron-to-chromium@^1.3.570:
5339-
version "1.3.570"
5340-
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.570.tgz#3f5141cc39b4e3892a276b4889980dabf1d29c7f"
5341-
integrity sha512-Y6OCoVQgFQBP5py6A/06+yWxUZHDlNr/gNDGatjH8AZqXl8X0tE4LfjLJsXGz/JmWJz8a6K7bR1k+QzZ+k//fg==
5339+
electron-to-chromium@^1.3.723:
5340+
version "1.3.739"
5341+
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.739.tgz#f07756aa92cabd5a6eec6f491525a64fe62f98b9"
5342+
integrity sha512-+LPJVRsN7hGZ9EIUUiWCpO7l4E3qBYHNadazlucBfsXBbccDFNKUBAgzE68FnkWGJPwD/AfKhSzL+G+Iqb8A4A==
53425343

53435344
elliptic@^6.5.3:
53445345
version "6.5.4"
@@ -5548,10 +5549,10 @@ es-to-primitive@^1.2.1:
55485549
is-date-object "^1.0.1"
55495550
is-symbol "^1.0.2"
55505551

5551-
escalade@^3.1.0:
5552-
version "3.1.0"
5553-
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.0.tgz#e8e2d7c7a8b76f6ee64c2181d6b8151441602d4e"
5554-
integrity sha512-mAk+hPSO8fLDkhV7V0dXazH5pDc6MrjBTPyD3VeKzxnVFjH1MIxbCdqGZB9O8+EwWakZs3ZCbDS4IpRt79V1ig==
5552+
escalade@^3.1.1:
5553+
version "3.1.1"
5554+
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
5555+
integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==
55555556

55565557
escape-goat@^2.0.0:
55575558
version "2.1.1"
@@ -10636,10 +10637,10 @@ node-object-hash@^2.0.0:
1063610637
resolved "https://registry.yarnpkg.com/node-object-hash/-/node-object-hash-2.0.0.tgz#9971fcdb7d254f05016bd9ccf508352bee11116b"
1063710638
integrity sha512-VZR0zroAusy1ETZMZiGeLkdu50LGjG5U1KHZqTruqtTyQ2wfWhHG2Ow4nsUbfTFGlaREgNHcCWoM/OzEm6p+NQ==
1063810639

10639-
node-releases@^1.1.61:
10640-
version "1.1.61"
10641-
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.61.tgz#707b0fca9ce4e11783612ba4a2fcba09047af16e"
10642-
integrity sha512-DD5vebQLg8jLCOzwupn954fbIiZht05DAZs0k2u8NStSe6h9XdsuIQL8hSRKYiU8WUQRznmSDrKGbv3ObOmC7g==
10640+
node-releases@^1.1.71:
10641+
version "1.1.72"
10642+
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.72.tgz#14802ab6b1039a79a0c7d662b610a5bbd76eacbe"
10643+
integrity sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw==
1064310644

1064410645
noms@0.0.0:
1064510646
version "0.0.0"

0 commit comments

Comments
 (0)