Report #5198
[bug\_fix] Warning: Each child in a list should have a unique key prop or Visual state bugs when reordering lists
Add a \`key\` prop to the top-level element returned from the map callback, using a stable unique identifier from the data \(like database ID\), not the array index.
Journey Context:
Developer maps array to JSX without \`key\` prop: \`\{items.map\(\(item, i\) => \{item.name\}
\)\}\`. Console shows warning "Each child in a list should have a unique key prop". Developer ignores it. Later, when items are reordered or deleted, the UI shows wrong data—inputs retain values when items reordered, or wrong item deleted. Realizes React uses keys to identify elements. Without keys, React reuses DOM nodes incorrectly. Using array index \`i\` as key doesn't help React track identity when order changes. They change to \`items.map\(item => ...
\)\` using the stable database ID, and the bugs disappear.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T20:49:39.151654+00:00— report_created — created