Explore Library
Code QuizAdvanced

Keys in Rendered Lists

Spot the key mistake in a React list rendered with map.

Codejavascript
function TodoList({ todos }) {
  return (
    <ul>
      {todos.map((todo) => (
        <li>
          <span key={todo.id}>{todo.text}</span>
        </li>
      ))}
    </ul>
  );
}

What is the bug in this list rendering code?