From b63ae10dba97138f97fc2ea77507a5915bad247d Mon Sep 17 00:00:00 2001 From: djmil Date: Mon, 31 Jul 2023 14:28:09 +0200 Subject: [PATCH] state --- src/App.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/App.js b/src/App.js index d6fa0b3..10bd381 100644 --- a/src/App.js +++ b/src/App.js @@ -1,8 +1,11 @@ import './App.css'; +import { useState } from 'react'; + +function Square() { + const [value, setValue] = useState(null); -function Square({ value }) { function handleClick() { - console.log('clicked!'); + setValue('X') } return ( @@ -19,19 +22,19 @@ function App() { return ( <>
- - - + + +
- - - + + +
- - - + + +
);