This checkpoint has no new ideas. It checks that you can use today's ideas
without the lesson walking you through them. Close the earlier lessons, read
the brief, and build it. Use the hints only when you've been stuck for a few
minutes.
The brief
Build a page for this course from three components:
CourseHeader shows the course name, React Beginner, as a heading.
Under it, a line reads 7 days, about 630 minutes in total. Work out both
numbers in JSX from two variables, days = 7 and 90 minutes a day. Don't
type 630 yourself.
LessonList shows a heading Day 1 lessons and a numbered list of
today's four lesson titles.
CourseFooter shows Next: Day 2, Props & Composition.
Each component lives in its own file in src/components/, with a default
export. App imports all three and shows them in order.
Acceptance checks:
The page shows all three parts, in order, with no errors or warnings in the
console.
Changing days to 5 changes the line to 5 days, about 450 minutes in
total without any other edits.
Build it
The starter includes an almost empty App.jsx and three component files under
src/components/. Each component currently returns null, which shows nothing.
Open the folder tree, replace one placeholder at a time, and import each
component into App.jsx. You can complete the whole brief in this browser.
Download project saves your work for later; Day 7 explains local setup.
Your workspaceReact · 7 files<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Course page</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
import { createRoot } from "react-dom/client";
import App from "./App.jsx";
import "./styles.css";
const root = createRoot(document.getElementById("root"));
root.render(<App />);
// Build the course page here.
// Put CourseHeader, LessonList and CourseFooter in src/components/,
// then import them into this file.
export default function App() {
return (
<main>
<p>Replace this paragraph with your components.</p>
</main>
);
}
body {
font: 16px/1.5 system-ui, sans-serif;
margin: 0;
color: #1c2430;
}
main {
max-width: 32rem;
margin: 1.5rem auto;
padding: 0 1rem;
}
.header h1 {
margin: 0;
}
.header p {
margin: 0 0 1rem;
color: #087ea4;
}
.card {
border: 1px solid #d6dde6;
border-radius: 8px;
padding: 0.75rem 1rem;
margin-bottom: 0.75rem;
}
.card h2 {
margin: 0 0 0.25rem;
font-size: 1.1rem;
}
// Build CourseFooter here.
export default function CourseFooter() {
return null;
}
// Build CourseHeader here.
export default function CourseHeader() {
return null;
}
// Build LessonList here.
export default function LessonList() {
return null;
}
Runs with Vite on your computer: unzip, then npm install and npm run dev.
Hint 1: order of work
Get one component on the screen before writing the next. Write
CourseHeader with plain text first, then replace the numbers with
expressions in curly braces.
Hint 2: lists and the ampersand
A numbered list is <ol> with one <li> per item. To show & in JSX you
can write it as is, or as &. Both work.
Show one solution
Open src/components in this lab to see each file. Your text and styling can
differ.