Question · Vibe coding with Claude Code course · Module 3: Twitter clone

The key prop with map()

Why do we add a key prop when rendering a list with map()?

Answer options

  • So React can distinguish the list items
  • To change the items' color
  • To sort the list alphabetically
  • To hide the list

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