Recap: JSX Expressions
Part of the Fundamentals section of Coddy's React journey — lesson 10 of 42.
Challenge
EasyChapter recap: a mini order summary, rendered entirely from JavaScript. App.jsx already defines item, price, quantity and a shout helper.
- Make the
<h1>withid="header"render the result of callingshout(item): it should showCOFFEE!. - Make the paragraph with
id="count"render3 cups, using thequantityvariable, not the digit. - Make the paragraph with
id="total"renderTotal: 12. Compute the number frompriceandquantitywith*, don't type 12.
Try it yourself
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div id="root"></div>
<script type="module" src="main.jsx"></script>
</body>
</html>All lessons in Fundamentals
2JSX Expressions
Curly BracesMath in BracesBraces in AttributesCalling Functions in JSXRecap: JSX Expressions5State & Events
What Is State?Click CounterCount in StepsToggle with StateIndependent StateRecap: State & Events8Project: Profile Card
Step 1: Card StructureStep 2: Card with PropsStep 3: Like ButtonStep 4: Follow Toggle