Skip to content

Commit a1f685c

Browse files
authored
docs: fix missing code highlights in tic-tac-toe tutorial (#3527)
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
1 parent 07cee61 commit a1f685c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎docs/learn/guides/tutorial-tic-tac-toe.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ To let the players know when the game is over, you can display text such as `'Wi
567567
display the winner or draw if the game is over and if the game is ongoing you'll display which
568568
player's turn is next:
569569

570-
```jsx {6-7,9,21}
570+
```jsx {6-7,9,20-21,40}
571571
export default function Board() {
572572
const xIsNext = useGameStore((state) => state.xIsNext)
573573
const setXIsNext = useGameStore((state) => state.setXIsNext)
@@ -946,7 +946,7 @@ Let's make the `Board` component fully controlled by the props it receives. To d
946946
the `Board` component to accept three props: `xIsNext`, `squares`, and a new `onPlay` function that
947947
the `Board` component can call with the updated squares array when a player makes a move.
948948

949-
```jsx {1}
949+
```jsx {1,11}
950950
function Board({ xIsNext, squares, onPlay }) {
951951
const winner = calculateWinner(squares)
952952
const turns = calculateTurns(squares)
@@ -1172,7 +1172,7 @@ You'll use `map` to transform your `history` of moves into React elements repres
11721172
screen, and display a list of buttons to **jump** to past moves. Let's `map` over the `history` in
11731173
the `Game` component:
11741174

1175-
```jsx {29-44}
1175+
```jsx {13-15,29-44}
11761176
export default function Game() {
11771177
const history = useGameStore((state) => state.history)
11781178
const setHistory = useGameStore((state) => state.setHistory)
@@ -1294,7 +1294,7 @@ function handlePlay(nextSquares) {
12941294
Finally, you will modify the `Game` component to render the currently selected move, instead of
12951295
always rendering the final move:
12961296

1297-
```jsx {2-8}
1297+
```jsx {4-5,8}
12981298
export default function Game() {
12991299
const history = useGameStore((state) => state.history)
13001300
const setHistory = useGameStore((state) => state.setHistory)
@@ -1360,7 +1360,7 @@ There's no need to store `xIsNext` separately in the state. It’s better to avo
13601360
because it can reduce bugs and make your code easier to understand. Instead, you can calculate
13611361
`xIsNext` based on `currentMove`:
13621362

1363-
```jsx {2-5,13,17}
1363+
```jsx {6,13,17}
13641364
export default function Game() {
13651365
const history = useGameStore((state) => state.history)
13661366
const setHistory = useGameStore((state) => state.setHistory)

0 commit comments

Comments
 (0)