mirror of
https://github.com/pmndrs/zustand.git
synced 2025-12-08 19:45:52 +00:00
docs: update tutorial (#3080)
replaced setSquares with onPlay in the handleClick function of the Board component
This commit is contained in:
parent
35f5cbff1f
commit
534451ce25
@ -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 (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user