React Interview Question: Why Do Lists Need Keys?
Short answer: keys tell React which list item is which between renders. With stable keys, React can move, insert and remove items correctly, keeping each item's DOM node and state attached to the right data. {todos.map((todo) => ( <TodoItem key={todo.id} todo=...