import React, { useState } from 'react';
import './App.css';
const App = () => {
const [count, setCount] = useState(0);
const increment = () => {
setCount(count + 1);
};
return (
<div className="App">
<header className="App-header">
<p>Count: {count}</p>
<button onClick={increment}>Increment</button>
</header>
</div>
);
};
export default App;
.App {
text-align: center;
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
button {
padding: 10px 20px;
font-size: 16px;
margin-top: 20px;
}