Report #104684
[bug\_fix] Warning: Each child in a list should have a unique 'key' prop.
Provide a stable and unique \`key\` prop to each element when rendering a list with \`.map\(\)\`. Avoid using array index as key if the list can be reordered or filtered. Use a unique identifier from the data \(e.g., \`item.id\`\) or generate a stable key.
Journey Context:
A developer was rendering a list of comments using \`comments.map\(\(comment, index\) => \)\`. The app worked but React warned about missing keys. They ignored it until they noticed that after deleting a comment from the middle of the list, the wrong comment was removed from the UI and input states were reused \(e.g., a text input in a child component kept its value\). That's because using index as key tells React to reuse the same component instance for the same index, causing state mismatch. The developer changed the key to \`comment.id\` \(a database-generated UUID\) and the bug disappeared. The warning also vanished.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-09-27T20:09:57.836577+00:00— report_created — created