Skip to content

Resolve conflict for last merge. #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions content/docs/handling-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@ function ActionLink() {

Ở đây, `e` là một sự kiện ảo. React định nghĩa những sự kiện ảo này dựa trên [chuẩn W3C](https://www.w3.org/TR/DOM-Level-3-Events/), nên bạn không cần lo lắng về sự tương thích giữa những browser. Hãy tham khảo tài liệu về [`SyntheticEvent`](/docs/events.html) để tìm hiểu thêm.

<<<<<<< HEAD
Khi làm việc với React, bạn thường không phải gọi `addEventListener` để gắn listener cho element DOM khi nó được khởi tạo. Thay vào đó, bạn chỉ cần gắn listener ngay lần đầu element được render.
=======
When using React, you generally don't need to call `addEventListener` to add listeners to a DOM element after it is created. Instead, just provide a listener when the element is initially rendered.
>>>>>>> 5b6ad388804aaa5cf5504ccd04329f52960e17ae
Khi làm việc với React, bạn thường không cần phải gọi `addEventListener` để gắn listener cho element DOM sau khi nó được khởi tạo. Thay vào đó, bạn chỉ cần cung cấp một listener ngay lần đầu element được render.

Khi bạn định nghĩa component bằng [class ES6](https://developer.mozilla.org/vi/docs/Web/JavaScript/Reference/Classes), một mẫu thiết kế phổ biến là sử dụng phương thức của class để bắt sự kiện. Ví dụ, component `Toggle` dưới đây render một chiếc nút để người dùng thay đổi giữa state “ON” và “OFF":

Expand Down Expand Up @@ -146,11 +142,7 @@ Vấn đề với cú pháp này nằm ở chỗ một callback khác sẽ đư

## Truyền Tham số vào Hàm Bắt Sự kiện {#passing-arguments-to-event-handlers}

<<<<<<< HEAD
Trong một vòng lặp, việc truyền thêm tham số vào hàm bắt sự kiện khá phổ biến. Nếu `id` là số định danh của một hàng, thì hai ví dụ duới đây đều hoạt động được:
=======
Inside a loop, it is common to want to pass an extra parameter to an event handler. For example, if `id` is the row ID, either of the following would work:
>>>>>>> 5b6ad388804aaa5cf5504ccd04329f52960e17ae
Bên trong một vòng lặp, người ta thường muốn truyền thêm một parameter cho một event handler. Ví dụ như, nếu `id` là ID của dòng (row), thì 2 dòng code bên dưới sẽ work:

```js
<button onClick={(e) => this.deleteRow(id, e)}>Delete Row</button>
Expand Down
6 changes: 1 addition & 5 deletions content/docs/introducing-jsx.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,4 @@ Chúng ta sẽ khám phá cách các React Element được render vào DOM th

>**Gợi ý:**
>
<<<<<<< HEAD
>Chúng tôi khuyến khích sử dụng [Định nghĩa ngôn ngữ "Babel"](https://babeljs.io/docs/editors) cho trình soạn thảo của bạn như vậy cả mã ES6 và JSX đều có thể được tô sáng rõ ràng. Trang web này dùng tập màu [Oceanic Next](https://labs.voronianski.com/oceanic-next-color-scheme/) cái mà phù hợp cho việc này.
=======
>We recommend using the ["Babel" language definition](https://babeljs.io/docs/editors) for your editor of choice so that both ES6 and JSX code is properly highlighted. This website uses the [Oceanic Next](https://github.com/voronianski/oceanic-next-color-scheme) color scheme which is compatible with it.
>>>>>>> 5b6ad388804aaa5cf5504ccd04329f52960e17ae
>Chúng tôi khuyến khích sử dụng [Định nghĩa ngôn ngữ "Babel"](https://babeljs.io/docs/editors) cho trình soạn thảo của bạn như vậy cả mã ES6 và JSX đều có thể được tô sáng rõ ràng. Trang web này dùng tập màu [Oceanic Next](https://github.com/voronianski/oceanic-next-color-scheme) cái mà phù hợp cho việc này.