Question: You are rendering a list with React when this warning appears in the console: "Warning: Each child in a list should have a unique 'key' prop." How do you fix this issue?

  1. Pass the name of each item as its key.
  2. Add a key prop with the same value to each item the list.
  3. Clear the console warnings.
  4. When iterating over the list items, add a unique property to each list item.

Answer: The correct answer of the above question is Option D:When iterating over the list items, add a unique property to each list item.