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 a518342 commit 44a428fCopy full SHA for 44a428f
src/App.js
@@ -11,8 +11,10 @@ function App() {
11
//increase points every second
12
setPoints(points + pointsPerSecond);
13
}, 1000);
14
- return () => clearInterval(interval); //clear interval when component unmounts
15
- });
+ return () => {
+ clearInterval(interval); //clear interval when component unmounts
16
+ };
17
+ }, []);
18
function addPointsFromClick() {
19
//add points from clicking a button
20
setPoints(points + clickMultiplier); //increase points by 1 when button clicked
0 commit comments