Stub web project

This commit is contained in:
2024-11-02 11:55:03 +01:00
parent 17a70e08d5
commit 092a05c3aa
19 changed files with 324 additions and 36 deletions

View File

@@ -0,0 +1,25 @@
import React from 'react'
import { add } from '../utils/calculator.js' // Note the .js extension
function App() {
const [result, setResult] = React.useState(0)
const handleCalculate = () => {
setResult(add(5, 3))
}
return (
<div className="p-4">
<h1 className="text-2xl font-bold mb-4">React App</h1>
<button
className="bg-blue-500 text-white px-4 py-2 rounded"
onClick={handleCalculate}
>
Calculate 5 + 3
</button>
<p className="mt-4">Result: {result}</p>
</div>
)
}
export default App