Skip to content

Commit 5da8c4c

Browse files
committed
Add comments in JSX
1 parent 3742916 commit 5da8c4c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/App.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import './App.css';
2-
import { useState } from 'react';
1+
import "./App.css";
2+
import { useState } from "react";
33
function App() {
44
//app compoment
55
const [points, setPoints] = useState(0); //set initial points to 0
@@ -12,10 +12,16 @@ function App() {
1212
return (
1313
//dynamic app HTML output
1414
<div className="App">
15-
<header className="App-header">Endless Simple Idle Game</header>
15+
{/*app context*/}
16+
<header className="App-header">
17+
{/*app header context*/}
18+
Endless Simple Idle Game
19+
</header>
1620
<p>Click the button to add points!</p>
17-
Points: <div id="points-display">{points}</div>
21+
{/*display current points value*/}Points:{" "}
22+
<div id="points-display">{points}</div>
1823
<br />
24+
{/*increase points from clicking a button*/}
1925
<button onClick={() => addPointsFromClick()}>Click to Add Points</button>
2026
</div>
2127
);

0 commit comments

Comments
 (0)