forked from elegantShock2258/tic-tac-toe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
27 lines (23 loc) · 769 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { useState } from "react";
function Square({value,onClick}){
return(
<div className="square" onClick={onClick}>
{value}
</div>
)
}
function Board(){
const board = (
<>
<Square value="" onClick={onSquareClick(0)}/>
<Square value="" onClick={onSquareClick(1)}/>
<Square value="" onClick={onSquareClick(2)}/>
<Square value="" onClick={onSquareClick(3)}/>
<Square value="" onClick={onSquareClick(4)}/>
<Square value="" onClick={onSquareClick(5)}/>
<Square value="" onClick={onSquareClick(6)}/>
<Square value="" onClick={onSquareClick(7)}/>
<Square value="" onClick={onSquareClick(8)}/>
</>
)
}