Skip to content

Commit 2fa515c

Browse files
committed
Using & Outputting Dynamic Values
1 parent 5ef63d4 commit 2fa515c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/App.jsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1+
const reactDescriptions = ['Fundamental', 'Crucial', 'Core'];
2+
3+
function genRandomInt(max) {
4+
return Math.floor(Math.random() * (max + 1));
5+
}
6+
17
function Header() {
8+
const description = reactDescriptions[genRandomInt(2)];
9+
210
return (
311
<header>
412
<img src="src/assets/react-core-concepts.png" alt="Stylized atom" />
513
<h1>React Essentials</h1>
614
<p>
7-
Fundamental React concepts you will need for almost any app you are
15+
{description} React concepts you will need for almost any app you are
816
going to build!
917
</p>
1018
</header>

0 commit comments

Comments
 (0)