Skip to content

Commit fab1207

Browse files
committed
docs: update content/learn/tutorial-tic-tac-toe.md
1 parent 1cde23e commit fab1207

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/content/learn/tutorial-tic-tac-toe.md

-3
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ export default function Square() {
301301
```
302302

303303
_브라우저_ 구역에 아래와 같이 X가 있는 사각형이 표시되어야 합니다.
304-
The _browser_ section should be displaying a square with an X in it like this:
305304

306305
![x가 채워진 사각형](../images/tutorial/x-filled-square.png)
307306

@@ -1412,7 +1411,6 @@ export default function Board() {
14121411
`O``X`를 덮어씌웁니다! 이렇게 하면 게임이 좀 더 흥미로워질 수 있지만 지금은 원래의 규칙을 유지하겠습니다.
14131412
14141413
지금은 `X``O`로 사각형을 표시할 때 먼저 해당 사각형에 이미 `X` 또는 `O`값이 있는지 확인하고 있지 않습니다. *일찍이 돌아와서* 이 문제를 해결하기 위해 사각형에 이미 `X``O`가 있는지 확인하겠습니다. 사각형이 이미 채워져 있는 경우 보드의 state를 업데이트하기 전에 `handleClick` 함수에서 조기에 `return` 하겠습니다.
1415-
When you mark a square with an `X` or an `O` you aren't first checking to see if the square already has an `X` or `O` value. You can fix this by *returning early*. You'll check to see if the square already has an `X` or an `O`. If the square is already filled, you will `return` in the `handleClick` function early--before it tries to update the board state.
14161414
14171415
```js {2,3,4}
14181416
function handleClick(i) {
@@ -1563,7 +1561,6 @@ function calculateWinner(squares) {
15631561
</Note>
15641562
15651563
`Board` 컴포넌트의 `handleClick` 함수에서 `calculateWinner(squares)`를 호출하여 플레이어가 이겼는지 확인하세요. 이 검사는 사용자가 이미 `X` 또는 `O`가 있는 사각형을 클릭했는지를 확인하는 것과 동시에 수행할 수 있습니다. 두 경우 모두 함수를 조기 반환하겠습니다.
1566-
You will call `calculateWinner(squares)` in the `Board` component's `handleClick` function to check if a player has won. You can perform this check at the same time you check if a user has clicked a square that already has an `X` or an `O`. We'd like to return early in both cases:
15671564
15681565
```js {2}
15691566
function handleClick(i) {

0 commit comments

Comments
 (0)