This commit is contained in:
djmil 2023-07-31 14:28:09 +02:00
parent 8a35feef7f
commit b63ae10dba

View File

@ -1,8 +1,11 @@
import './App.css'; import './App.css';
import { useState } from 'react';
function Square() {
const [value, setValue] = useState(null);
function Square({ value }) {
function handleClick() { function handleClick() {
console.log('clicked!'); setValue('X')
} }
return ( return (
@ -19,19 +22,19 @@ function App() {
return ( return (
<> <>
<div className="board-row"> <div className="board-row">
<Square value="1"/> <Square />
<Square value="2"/> <Square />
<Square value="3"/> <Square />
</div> </div>
<div className="board-row"> <div className="board-row">
<Square value="4"/> <Square />
<Square value="5"/> <Square />
<Square value="6"/> <Square />
</div> </div>
<div className="board-row"> <div className="board-row">
<Square value="7"/> <Square />
<Square value="8"/> <Square />
<Square value="9"/> <Square />
</div> </div>
</> </>
); );