Let’ go step by step, 1] Create Board — 3*3 const [board, setBoard] = useState(Array(9).fill(null)); 2] Create state to maintain who is the nextPlayer, const [isXNext, setIsXNext] = useState(true); 2] Loop the board which create each cell <div className="board">
{board.map((cell, index) => (
<div key={index} className="cell" onClick={() => handleClick(index)}>
{cell}
</div>
))}
</div>