Skip to content

Commit 857cebe

Browse files
authored
Update tutorial.md
1 parent 2fa40b3 commit 857cebe

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

content/tutorial/tutorial.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -451,19 +451,11 @@ class Square extends React.Component {
451451

452452
Khi một Square được bấm, hàm `onClick` cung cấp bởi Board sẽ được gọi. Dưới đây là tổng kết lại những gì ta đã đạt được đến thời điểm này:
453453

454-
<<<<<<< HEAD
455454
1. Prop `onClick` trong DOM có sẵn `button` component cho phép React lắng nghe sự kiện nhấp chuột.
456455
2. Khi button được bấm, React sẽ gọi hàm `onClick` được định nghĩa trong phương thức `render` của Square component.
457456
3. Hàm xử lý sự kiện này sẽ gọi hàm `this.props.onClick()`. Prop `onClick` của Square component được chỉ định bởi Board component.
458457
4. Khi Board componet truyền prop `onClick={() => this.handleClick(i)}` xuống Square component, Square sẽ gọi hàm `this.handleClick(i)` khi nó được bấm.
459458
5. Chúng ta chưa hề định nghĩa phương thức `handleClick()` vì vậy code của chúng ta sẽ không chạy được ở thời điểm hiện tại. Khi bấm vào một Square, bạn sẽ thấy lỗi được trả ra trên màn hình dạng như "this.handleClick is not a function".
460-
=======
461-
1. The `onClick` prop on the built-in DOM `<button>` component tells React to set up a click event listener.
462-
2. When the button is clicked, React will call the `onClick` event handler that is defined in Square's `render()` method.
463-
3. This event handler calls `this.props.onClick()`. The Square's `onClick` prop was specified by the Board.
464-
4. Since the Board passed `onClick={() => this.handleClick(i)}` to Square, the Square calls the Board's `handleClick(i)` when clicked.
465-
5. We have not defined the `handleClick()` method yet, so our code crashes. If you click a square now, you should see a red error screen saying something like "this.handleClick is not a function".
466-
>>>>>>> 23d03a854ba21aeea0a03a0bd5185e0def9237d6
467459

468460
>Chú ý
469461
>

0 commit comments

Comments
 (0)