Skip to content

Commit b254c5d

Browse files
authored
Merge pull request #240 from reactjs/sync-9b3c3f4e
Sync with reactjs.org @ 9b3c3f4
2 parents 6f3f108 + 0632a4b commit b254c5d

File tree

6 files changed

+27
-0
lines changed

6 files changed

+27
-0
lines changed

content/community/support.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,18 @@ 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
2728
* [Cộng đồng React của DEV](https://dev.to/t/react)
2829
* [Cộng đồng React của Hashnode](https://hashnode.com/n/reactjs)
2930
* [Trò chuyện online với Reactiflux](https://discord.gg/reactiflux)
3031
* [Cộng đồng React của Reddit](https://www.reddit.com/r/reactjs/)
3132
* [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
3239
3340
## Tin tức {#news}
3441

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,11 @@ 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
152153
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
153157
154158
### Thử nhanh JSX {#quickly-try-jsx}
155159

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+
>>>>>>> 9b3c3f4e613440baf2e2f1775be65dac8c08ab5f
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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,11 @@ 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
141142
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
142146
143147
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.
144148

content/tutorial/tutorial.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,13 @@ 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
10481049
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
10491055
10501056
> Warning:
10511057
> Each child in an array or iterator should have a unique "key" prop. Check the render method of "Game".

vercel.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"trailingSlash": false,
44
"redirects": [
55
{ "source": "/tips/controlled-input-null-value.html", "destination": "/docs/forms.html#controlled-input-null-value", "permanent": false },
6+
{ "source": "/link/switch-to-createroot", "destination": "https://github.com/reactwg/react-18/discussions/5", "permanent": false },
7+
{ "source": "/server-components", "destination": "/blog/2020/12/21/data-fetching-with-react-server-components.html", "permanent": false },
68
{ "source": "/concurrent", "destination": "/docs/concurrent-mode-intro.html", "permanent": false },
79
{ "source": "/hooks", "destination": "/docs/hooks-intro.html", "permanent": false },
810
{ "source": "/tutorial", "destination": "/tutorial/tutorial.html", "permanent": false },

0 commit comments

Comments
 (0)