Skip to content

Commit 9f149ce

Browse files
committed
commit
1 parent 2ee036c commit 9f149ce

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React from "react";
2+
import { useCount } from "./context";
3+
import CountRenderer from "./CountRenderer";
4+
5+
const Counter = () => {
6+
const count = useCount();
7+
8+
return (
9+
<div style={styles.container}>
10+
<CountRenderer />
11+
<button style={styles.button} onClick={() => count.set(count + 1)}>
12+
Increment
13+
</button>
14+
</div>
15+
);
16+
};
17+
18+
const styles = {
19+
container: {
20+
display: "flex",
21+
flexDirection: "column",
22+
alignItems: "center",
23+
justifyContent: "center",
24+
height: "100vh",
25+
},
26+
button: {
27+
marginTop: 10,
28+
},
29+
};
30+
31+
export default Counter;

0 commit comments

Comments
 (0)