JavaScript por Radu TM • June 10, 2022
import React, { useState } from 'react';
function App() {
const [count, setCount] = useState(0);
const increment = () => {
setCount(currentCount => {
return currentCount + 1;
});
};
return (
<div>
<h1>{count}</h1>
<button onClick={increment}>aumentar</button>
</div>
);
}
0
34.041