We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ee036c commit 9f149ceCopy full SHA for 9f149ce
week-7-messed-up-code/store/atoms/count.jsx
@@ -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