docs: update tutorial (#3080)

replaced setSquares with onPlay in the handleClick function of the Board component
This commit is contained in:
Emmanuel Oduntan 2025-04-11 22:23:46 +01:00 committed by GitHub
parent 35f5cbff1f
commit 534451ce25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -957,7 +957,7 @@ function Board({ xIsNext, squares, onPlay }) {
if (squares[i] || winner) return
const nextSquares = squares.slice()
nextSquares[i] = player
setSquares(nextSquares)
onPlay(nextSquares)
}
return (