([2,2,2,2,2,2,2,2,2]);
const turn = props.turn;
const getBoard = (index: number) => {
const newBoard: number[] = board.slice(0, index).concat(turn).concat(board.slice(index+1, 9));
socket.emit("update-remote-board", newBoard);
props.setTurn(turn === 1 ? 0 : 1);
}
useState(() => {
socket.on("update-client-board", (remoteBoard) => {
setBoard(remoteBoard);
});
});
return (
{
board.map(
(i, index) =>
)
}
);
}
export default MultiplayerGrid;