Skip to content

Commit 5b3e8a5

Browse files
authored
Merge pull request #241 from reactjs/sync-4133943e
Sync with reactjs.org @ 4133943
2 parents cf9f7bd + 3c1a347 commit 5b3e8a5

File tree

5 files changed

+7
-23
lines changed

5 files changed

+7
-23
lines changed

content/community/support.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,11 @@ Có rất nhiều diễn đàn online là nơi tuyệt vời để thảo luận
2424

2525
Mỗi cộng đồng bao gồm hàng nghìn người dùng React.
2626

27-
<<<<<<< HEAD
2827
* [Cộng đồng React của DEV](https://dev.to/t/react)
2928
* [Cộng đồng React của Hashnode](https://hashnode.com/n/reactjs)
3029
* [Trò chuyện online với Reactiflux](https://discord.gg/reactiflux)
3130
* [Cộng đồng React của Reddit](https://www.reddit.com/r/reactjs/)
3231
* [Cộng đồng React của Spectrum](https://spectrum.chat/react)
33-
=======
34-
* [DEV's React community](https://dev.to/t/react)
35-
* [Hashnode's React community](https://hashnode.com/n/reactjs)
36-
* [Reactiflux online chat](https://discord.gg/reactiflux)
37-
* [Reddit's React community](https://www.reddit.com/r/reactjs/)
38-
>>>>>>> 9b3c3f4e613440baf2e2f1775be65dac8c08ab5f
3932

4033
## Tin tức {#news}
4134

content/docs/add-react-to-a-website.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,7 @@ return (
149149

150150
Hai đoạn code trên là tương đương nhau. Trong khi **JSX [hoàn toàn là tuỳ chọn](/docs/react-without-jsx.html)**, nhiều người thấy rằng nó khá hữu ích cho việc viết UI code -- cả với React và với các thư viện khác.
151151

152-
<<<<<<< HEAD
153-
Bạn có thể trải nghiệm với JSX bằng cách sử dụng [bộ chuyển đổi online](https://babeljs.io/en/repl#?babili=false&browsers=&build=&builtIns=false&spec=false&loose=false&code_lz=DwIwrgLhD2B2AEcDCAbAlgYwNYF4DeAFAJTw4B88EAFmgM4B0tAphAMoQCGETBe86WJgBMAXJQBOYJvAC-RGWQBQ8FfAAyaQYuAB6cFDhkgA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=es2015%2Creact%2Cstage-2&prettier=false&targets=&version=7.4.3).
154-
=======
155-
You can play with JSX using [this online converter](https://babeljs.io/en/repl#?babili=false&browsers=&build=&builtIns=false&spec=false&loose=false&code_lz=DwIwrgLhD2B2AEcDCAbAlgYwNYF4DeAFAJTw4B88EAFmgM4B0tAphAMoQCGETBe86WJgBMAXJQBOYJvAC-RGWQBQ8FfAAyaQYuAB6cFDhkgA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=es2015%2Creact%2Cstage-2&prettier=false&targets=&version=7.15.7).
156-
>>>>>>> 9b3c3f4e613440baf2e2f1775be65dac8c08ab5f
152+
Bạn có thể trải nghiệm với JSX bằng cách sử dụng [bộ chuyển đổi online](https://babeljs.io/en/repl#?babili=false&browsers=&build=&builtIns=false&spec=false&loose=false&code_lz=DwIwrgLhD2B2AEcDCAbAlgYwNYF4DeAFAJTw4B88EAFmgM4B0tAphAMoQCGETBe86WJgBMAXJQBOYJvAC-RGWQBQ8FfAAyaQYuAB6cFDhkgA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=es2015%2Creact%2Cstage-2&prettier=false&targets=&version=7.15.7).
157153

158154
### Thử nhanh JSX {#quickly-try-jsx}
159155

content/docs/hooks-faq.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,9 +912,13 @@ Lưu ý bạn có thể chọn giữa truyền *state* của ứng dụng xuốn
912912

913913
>Lưu ý
914914
>
915+
<<<<<<< HEAD
915916
>Chúng tôi đề xuất [truyền `dispatch` xuống các context](#how-to-avoid-passing-callbacks-down) thay vì các callback độc lập qua prop. Cách tiếp cận bên dưới chỉ đề cập ở đây để đầy đủ và như là một cách hatch.
916917
>
917918
>Cũng lưu ý rằng pattern này có thể gây ra vấn đề trong [chế độ concurrent ](/blog/2018/03/27/update-on-async-rendering.html). Chúng tôi có kế hoạch cung cấp một cách làm khác hữu hiệu trong tương lai, nhưng giải pháp an toàn nhất hiện nay là luôn luôn vô hiệu hóa callback nếu một vài giá trị phụ thuộc vào thay đổi.
919+
=======
920+
>We recommend to [pass `dispatch` down in context](#how-to-avoid-passing-callbacks-down) rather than individual callbacks in props. The approach below is only mentioned here for completeness and as an escape hatch.
921+
>>>>>>> 4133943e718a77f11627888db2f59f6cb7a73403
918922
919923
Trong vài trường hợp các biệt, bạn cần nhớ 1 callback với [`useCallback`](/docs/hooks-reference.html#usecallback) nhưng việc nhớ này không làm việc tốt bởi vì hàm bên trong bị re-create quá nhiều lần. Nếu hàm bạn nhớ là một hàm xử lý sự kiện và không được sử dụng trong quá trình render, bạn có thể sử dụng [ref như một biến instance](#is-there-something-like-instance-variables), và lưu giá trị lần commit sau cùng một cách thủ công:
920924

content/docs/thinking-in-react.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Sau khi kết thúc, bạn sẽ có những thư viện có thể tái sử dụ
7373

7474
Tham khảo [tài liệu React](/docs/) nếu như bạn cần trợ giúp để thực hiện bước này.
7575

76-
### Bản tóm tắt ngắn gọn: Props và State {#a-brief-interlude-props-vs-state}
76+
Xem [React docs](/docs/getting-started.html) nếu bạn cần trợ giúp ở bước này.
7777

7878
Có 2 kiểu "mô hình" dữ liệu trong React: props và state. Hiểu ra sự khác biệt giữa prop và state là điều rất quan trọng; Tham khảo [Những tài liệu từ React](/docs/state-and-lifecycle.html) nếu bạn thực sự không hiểu ra sự khác biệt đó. Xem thêm phần [FAQ: Sự khác nhau giữa prop và state là gì?](/docs/faq-state.html#what-is-the-difference-between-state-and-props)
7979

@@ -138,11 +138,7 @@ React làm cho luồng dữ liệu trở nên rõ ràng và dễ hiểu hơn ch
138138

139139
Nếu bạn thử gõ hoặc lựa chọn giá trị trong ví dụ hiện thời, bạn sẽ thấy rằng React bỏ qua những giá trị đầu vào này. Điều này sảy ra có chủ ý, vì chúng ta gán `value` prop của `input` luôn luôn bằng với `state` truyền từ `FilterableProductTable`.
140140

141-
<<<<<<< HEAD
142141
Hãy nghĩ xem chúng ta muốn thực hiện điều gì. Chúng ta muốn chắc chắn rằng khi nào người dùng thay đổi form, chúng ta cập nhật state dựa trên dữ liệu đầu vào. Vì những component chỉ nên cập nhật state cuả chúng, `FilterableProductTable` sẽ truyền vào callbacks tới `SearchBar` để kích hoạt mỗi khi dữ liệu cần cập nhật. Chúng ta có thể sử dụng sự kiện `onChange` trong input để nhận được thông báo. Callbacks truyền xuống bởi `FilterableProductTable` sẽ gọi hàm `setState()`, và ứng dụng sẽ được cập nhật.
143-
=======
144-
If you try to type or check the box in the previous version of the example (step 4), you'll see that React ignores your input. This is intentional, as we've set the `value` prop of the `input` to always be equal to the `state` passed in from `FilterableProductTable`.
145-
>>>>>>> 9b3c3f4e613440baf2e2f1775be65dac8c08ab5f
146142

147143
Mặc dù nó nghe phức tạp, nhưng thật ra chỉ cần vài dòng lệnh. Và nó chỉ ra rất rõ ràng luồng dữ liệu được truyền đi trong ứng dụng như thế nào.
148144

content/tutorial/tutorial.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,13 +1045,8 @@ Hãy `map` mảng `history` trong phương thức `render` của Game component:
10451045

10461046
**[Xem code chi tiết tại bước này](https://codepen.io/gaearon/pen/EmmGEa?editors=0010)**
10471047

1048-
<<<<<<< HEAD
10491048
Với mỗi lịch sử bước đi trong game tic-tac-toe, ta tạo ra một danh sách các `<li>` chứa một `<button>`. Button sẽ có một hàm xử lý `onClick`, hàm này sẽ gọi phương thức `this.jumpTo()`. Hiện tại ta chưa có hàm `jumpTo()`. Đến bước này, bạn sẽ thấy một danh sách các bước đi được hiển thị trên màn hình và cảnh báo trong console của công cụ cho nhà phát triển với thông điệp như sau:
1050-
=======
1051-
As we iterate through `history` array, `step` variable refers to the current `history` element value, and `move` refers to the current `history` element index. We only interested in `move` here, hence `step` is not getting assigned to anything.
1052-
1053-
For each move in the tic-tac-toe game's history, we create a list item `<li>` which contains a button `<button>`. The button has a `onClick` handler which calls a method called `this.jumpTo()`. We haven't implemented the `jumpTo()` method yet. For now, we should see a list of the moves that have occurred in the game and a warning in the developer tools console that says:
1054-
>>>>>>> 9b3c3f4e613440baf2e2f1775be65dac8c08ab5f
1049+
Khi chúng ta loop qua mảng `history`, `step` biến này ánh xạ tới value của element `history`. Và `move` ánh xạ tới `history` element index. Chúng ta chỉ quan tâm tới `move` ở đây, vì thế `step` sẽ không được gán.
10551050

10561051
> Warning:
10571052
> Each child in an array or iterator should have a unique "key" prop. Check the render method of "Game".

0 commit comments

Comments
 (0)