Files
serviceCRM/frontend/servicecrm/src/components/Btn.jsx
ferdzo 2e515c267a Test
2024-04-11 18:13:46 +02:00

26 lines
518 B
JavaScript

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;