Spaces:
No application file
No application file
| import { useState } from 'react' | |
| function App() { | |
| const [count, setCount] = useState(0) | |
| return ( | |
| <div style={{ padding: '20px', textAlign: 'center' }}> | |
| <h1>Welcome to Your React App</h1> | |
| <p>Edit <code>src/App.jsx</code> and save to reload.</p> | |
| <div style={{ marginTop: '20px' }}> | |
| <button | |
| onClick={() => setCount((count) => count + 1)} | |
| style={{ | |
| padding: '10px 20px', | |
| fontSize: '16px', | |
| backgroundColor: '#007bff', | |
| color: 'white', | |
| border: 'none', | |
| borderRadius: '5px', | |
| cursor: 'pointer' | |
| }} | |
| > | |
| Count is: {count} | |
| </button> | |
| </div> | |
| <p style={{ marginTop: '20px', color: '#666' }}> | |
| Click the button to test React state management | |
| </p> | |
| </div> | |
| ) | |
| } | |
| export default App |