You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1325,7 +1325,7 @@ Let's recap what happens when a user clicks the top left square on your board to
1325
1325
1. `handleClick` uses the argument (`0`) to update the first element of the `squares` array from `null` to `X`.
1326
1326
1. The `squares` state of the `Board` component was updated, so the `Board` and all of its children re-render. This causes the `value` prop of the `Square` component with index `0` to change from `null` to `X`.
1327
1327
1328
-
In the end the user sees that the upper left square has changed from empty to having a`X` after clicking it.
1328
+
In the end the user sees that the upper left square has changed from empty to having an`X` after clicking it.
1329
1329
1330
1330
<Note>
1331
1331
@@ -1406,7 +1406,7 @@ But wait, there's a problem. Try clicking on the same square multiple times:
1406
1406
1407
1407
The `X` is overwritten by an `O`! While this would add a very interesting twist to the game, we're going to stick to the original rules for now.
1408
1408
1409
-
When you mark a square with a`X` or an `O` you aren't first checking to see if the square already has a`X` or `O` value. You can fix this by *returning early*. You'll check to see if the square already has a`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.
1409
+
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.
1410
1410
1411
1411
```js {2,3,4}
1412
1412
functionhandleClick(i) {
@@ -1556,7 +1556,7 @@ It does not matter whether you define `calculateWinner` before or after the `Boa
1556
1556
1557
1557
</Note>
1558
1558
1559
-
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 a`X` or and`O`. We'd like to return early in both cases:
1559
+
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:
0 commit comments