Skip to content

Commit 5ef0217

Browse files
authored
Update tutorial.md
1 parent 999c65a commit 5ef0217

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
@@ -243,11 +243,7 @@ class Square extends React.Component {
243243
}
244244
```
245245

246-
<<<<<<< HEAD
247246
Nếu bạn bấm vào một ô Square, bạn sẽ nhìn thấy một cảnh báo hiện ra trên trình duyệt
248-
=======
249-
If you click on a Square now, you should see 'click' in your browser's devtools console.
250-
>>>>>>> a11c2534062bd79cc1e6e34db0e149f928df35bb
251247

252248
>Chú ý
253249
>
@@ -265,11 +261,7 @@ If you click on a Square now, you should see 'click' in your browser's devtools
265261
>}
266262
>```
267263
>
268-
<<<<<<< HEAD
269264
>Để ý thấy rằng bằng cách viết `onClick={() => alert('click')}`, ta đã truyền *một hàm (function)* thông qua prop `onClick`. React sẽ chỉ thực hiện hàm này khi Square component được bấm. Quên không viết `() =>` mà chỉ viết `onClick={alert('click')}` là một lỗi cơ bản trong react, khi viết như thế, cảnh báo (alert) sẽ được hiện mỗi khi component render lại.
270-
=======
271-
>Notice how with `onClick={() => console.log('click')}`, we're passing *a function* as the `onClick` prop. React will only call this function after a click. Forgetting `() =>` and writing `onClick={console.log('click')}` is a common mistake, and would fire every time the component re-renders.
272-
>>>>>>> a11c2534062bd79cc1e6e34db0e149f928df35bb
273265
274266
Ở bước tiếp theo, chúng ta muốn Square component "ghi nhớ" rằng nó đã được bấm, và hiện giá trị "X" trên nó. Để "ghi nhớ" mọi thứ, các component sử dụng **state**.
275267

0 commit comments

Comments
 (0)