HomeChallengesRepsProblemsLeaderboardTake a challenge

Components inside components

<Panel> ignores what is put inside it, so the order’s items never appear, and both components take any. Give Panel real children, ItemRow a real item, and the rows a stable key.

Intermediate8 min on the clock5 graded checks · 100 pointsTyped React
Graded by running your code against real cases.

What you build

  • type PanelProps = { title: string; children: ReactNode }, and render the children
  • type ItemRowProps = { item: MenuItem }
  • Key the rows by item.id, not by index

Done means

Children typed and rendered, rows typed, keys stable, and the items show.

How it is graded

Published in full, before you start — every point is one of these and there is nothing else. Each one runs your code; it is not a search for keywords.

  1. children is typed as ReactNode+20Slots and children
  2. Refuses a Panel with no title+15Data flows down
  3. Refuses an order passed as an item+20TypeScript basics
  4. Rows are keyed by item.id+25Lists and their rows
  5. The items show inside the panel+20Slots and children

What it teaches

The rest of Typed React