Skip to content

Commit 3742916

Browse files
committed
Add clicks variable
1 parent d8b4e28 commit 3742916

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/App.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ import { useState } from 'react';
33
function App() {
44
//app compoment
55
const [points, setPoints] = useState(0); //set initial points to 0
6+
const [clicks, setClicks] = useState(0); //set initial clicks pressed to 0
67
function addPointsFromClick() {
78
//add points from clicking a button
89
setPoints(points + 1); //increase points by 1 when button clicked
10+
setClicks(clicks + 1); //increase clicks made by 1
911
}
1012
return (
1113
//dynamic app HTML output

0 commit comments

Comments
 (0)