Skip to content

Commit

Permalink
Merge pull request #76 from reactjs/fix/conflicts
Browse files Browse the repository at this point in the history
Resolve conflict for last merge.
  • Loading branch information
ltmylinh committed Jan 3, 2020
2 parents 0ca6b61 + cdc96ac commit 0cf0236
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
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.

0 comments on commit 0cf0236

Please sign in to comment.