This commit is contained in:
ferdzo
2024-04-11 18:13:46 +02:00
parent f001621cdc
commit 2e515c267a
14 changed files with 2077 additions and 37 deletions

View File

@@ -0,0 +1,26 @@
import React from 'react';
import {useState} from 'react';
function MyButton(){
const [count, setCount]=useState(0);
function handleClick(){
setCount(count+1);
}
return(
<div>
<Dugme count={count} handleClick={handleClick}/>
<Dugme count={count} handleClick={handleClick}/>
</div>
)
}
function Dugme({count, handleClick}){
return(
<button onClick={handleClick}>Clicked {count} times</button>
)
}
export default MyButton;