@@ -567,7 +567,7 @@ To let the players know when the game is over, you can display text such as `'Wi
567567display the winner or draw if the game is over and if the game is ongoing you'll display which
568568player's turn is next:
569569
570- ``` jsx {6-7,9,21 }
570+ ``` jsx {6-7,9,20-21,40 }
571571export 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
946946the ` Board ` component to accept three props: ` xIsNext ` , ` squares ` , and a new ` onPlay ` function that
947947the ` Board ` component can call with the updated squares array when a player makes a move.
948948
949- ``` jsx {1}
949+ ``` jsx {1,11 }
950950function 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
11721172screen, and display a list of buttons to ** jump** to past moves. Let's ` map ` over the ` history ` in
11731173the ` Game ` component:
11741174
1175- ``` jsx {29-44}
1175+ ``` jsx {13-15, 29-44}
11761176export default function Game () {
11771177 const history = useGameStore ((state ) => state .history )
11781178 const setHistory = useGameStore ((state ) => state .setHistory )
@@ -1294,7 +1294,7 @@ function handlePlay(nextSquares) {
12941294Finally, you will modify the ` Game ` component to render the currently selected move, instead of
12951295always rendering the final move:
12961296
1297- ``` jsx {2- 8}
1297+ ``` jsx {4-5, 8}
12981298export 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
13601360because 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}
13641364export default function Game () {
13651365 const history = useGameStore ((state ) => state .history )
13661366 const setHistory = useGameStore ((state ) => state .setHistory )
0 commit comments