From ef0c619fac5f520bc9d7d818d7f68d7b77397fbe Mon Sep 17 00:00:00 2001 From: Danilo Britto Date: Tue, 21 Jan 2025 11:06:48 -0500 Subject: [PATCH] chore(docs): update tutorial tic tac toe (#2969) * chore(docs): update tutorial tic tac toe * chore(docs): update tutorial tic tac toe * chore(docs): minor changes --- docs/guides/tutorial-tic-tac-toe.md | 152 ++++++++++++++-------------- 1 file changed, 75 insertions(+), 77 deletions(-) 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 (