diff --git a/docs/guides/tutorial-tic-tac-toe.md b/docs/guides/tutorial-tic-tac-toe.md index 559e70b7c6..2c38ad869f 100644 --- a/docs/guides/tutorial-tic-tac-toe.md +++ b/docs/guides/tutorial-tic-tac-toe.md @@ -123,7 +123,10 @@ function Board({ xIsNext, squares, onPlay }) { } export default function Game() { - const { history, setHistory, currentMove, setCurrentMove } = useGameStore() + const history = useGameStore((state) => state.history) + const setHistory = useGameStore((state) => state.setHistory) + const currentMove = useGameStore((state) => state.currentMove) + const setCurrentMove = useGameStore((state) => state.setCurrentMove) const xIsNext = currentMove % 2 === 0 const currentSquares = history[currentMove] @@ -215,7 +218,7 @@ The `Square` component should take `value` and `onSquareClick` as props. It shou Here's the code for the `Square` component: -```tsx +```jsx function Square({ value, onSquareClick }) { return (