Command Palette

Search for a command to run...

Hectal
Phase 1: JSX: Writing UI in JavaScript
React · Exercise 5 of 6 PreviousNext
Intermediate

Build a menu without JSX

Prove you know what JSX compiles to: build this menu without writing a single tag, using createElement from react (or jsx/jsxs from react/jsx-runtime):

A <nav> with the class tabs containing three links (<a>): Home to #home, Shop to #shop and Help to #help. The Shop link also has the class active and aria-current="page".

Render it into the root, also without JSX (createElement(Menu) instead of <Menu />). Your file must contain no < tags at all.

What Check tests

  1. The nav has three links: Home, Shop, Help
  2. The links point to #home, #shop and #help
  3. Only Shop is active, with aria-current="page"
  4. The file contains no JSX tags

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.