blob: 67541a78bae6c51df378785814e3a453d1fcb8b5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
import { useState } from "react";
export function Counter() {
console.log('counter b loaded');
const [count, setCount] = useState(0);
function increment() {
setCount(count + 2);
}
function decrement() {
setCount(count - 2);
}
return (
<div id="counter-fixture" className="rounded-br-full">
<p>Count B: {count}</p>
<button className="inc" onClick={increment}>
+
</button>
<button className="dec" onClick={decrement}>
-
</button>
</div>
);
}
|