added orai
This commit is contained in:
18
24_12_09/komponensek/src/Button.js
Normal file
18
24_12_09/komponensek/src/Button.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import React from "react";
|
||||
import { useState } from "react";
|
||||
|
||||
function Counter(){
|
||||
const [count, setCount] = useState(0);
|
||||
|
||||
function handleClick(){
|
||||
setCount(count + 1);
|
||||
}
|
||||
|
||||
return (
|
||||
<button onClick={handleClick}>
|
||||
Ennyiszer nyomtál meg: {count}
|
||||
</button>
|
||||
)
|
||||
}
|
||||
|
||||
export default Counter;
|
||||
Reference in New Issue
Block a user