Command Palette

Search for a command to run...

Hectal
Phase 2: Components and Props
React · Exercise 1 of 5Next
Beginner

One component, three greetings

The Greeting component always says Hello, friend!. Give it a name prop so each use can greet someone different.

Render three greetings in App: Hello, Asha!, Hello, Ravi! and Hello, Meera!. Each must be an <h2 className="greeting">.

What Check tests

  1. There are exactly three .greeting headings
  2. They say Hello, Asha!, Hello, Ravi! and Hello, Meera! in that order
  3. Greeting is still one component used three times

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.