Question · Vibe coding with Claude Code course · Module 7: LinkedIn clone

Quiz: key on a filter field

Why key={filters.location} on the port selection list in JobFilters?

Answer options

  • So React sorts the ports alphabetically
  • Because next/form requires key on every field
  • So the field is created anew when the address changes; without key the old value stays after Clear filters
  • So the browser remembers the choice after the tab is closed

You can check the correct answer by solving this task in the CodeWorlds game.