Command Palette

Search for a command to run...

Hectal
Phase 13: Routing
React · Exercise 1 of 6Next
Beginner

Your first routes

The app has a router and a Home page. Add two more pages: About (path /about, heading <h1>About</h1>) and Contact (path /contact, heading <h1>Contact</h1>).

Add links to them in the <nav> using React Router's Link (not a plain <a>), so clicking them changes the page without a reload. The address bar at the top must show the current path.

What Check tests

  1. The app starts on the Home page
  2. There are links to /about and /contact
  3. Clicking About shows the About page and /about in the address bar
  4. Clicking Contact shows the Contact page
  5. Clicking Home goes back to the Home page

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.