Command Palette

Search for a command to run...

Hectal
Phase 2: Components and Props
React · Exercise 4 of 5 PreviousNext
Beginner

A Panel with children and a footer slot

Write a Panel wrapper component with three props: title, children and an optional footer.

It renders <section className="panel"> containing an <h2> with the title, then a <div className="panel-body"> with the children, then (only if a footer was passed) a <footer> holding the footer.

App is already written: it uses Panel twice, once with a footer and once without.

What Check tests

  1. Two panels titled Profile and Notes
  2. The Profile panel's body shows its two paragraphs
  3. The Notes panel's body shows the list with two items
  4. The Profile panel has a footer with an Edit button
  5. The Notes panel has no footer at all

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.

Console

Nothing logged yet.