Upload 1.6

This commit is contained in:
AndrewTrieu
2023-03-13 16:05:56 +02:00
parent 1af8f44a3c
commit e67e6831da
18 changed files with 17565 additions and 0 deletions

26
part1/unicafe/src/App.js Normal file
View File

@@ -0,0 +1,26 @@
import { useState } from "react";
const App = () => {
// save clicks of each button to its own state
const [good, setGood] = useState(0);
const [neutral, setNeutral] = useState(0);
const [bad, setBad] = useState(0);
return (
<div>
<h1>give feedback</h1>
<button onClick={() => setGood(good + 1)}>good</button>
<button onClick={() => setNeutral(neutral + 1)}>neutral</button>
<button onClick={() => setBad(bad + 1)}>bad</button>
<h1>statistics</h1>
<p>good {good}</p>
<p>neutral {neutral}</p>
<p>bad {bad}</p>
</div>
);
};
export default App;