We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aefaafa commit e52efeaCopy full SHA for e52efea
use-state/react/src/Counter.js
@@ -1,13 +1,14 @@
1
-import React, { useState } from 'react';
+import React, { useState } from 'react'
2
3
export default function Counter() {
4
- const [count, setCount] = useState(0);
+ const [count, setCount] = useState(0)
5
+
6
return (
7
<>
8
Count: {count}
9
<button onClick={() => setCount(0)}>Reset</button>
10
<button onClick={() => setCount(prevCount => prevCount - 1)}>-</button>
11
<button onClick={() => setCount(prevCount => prevCount + 1)}>+</button>
12
</>
- );
13
+ )
14
}
0 commit comments