Loading…
Loading…
Main already had a simple CommentList with no interactivity. A colleague sent a PR adding a reply form under each comment and a separate Tabs component for navigation. QA complains: when a middle comment is deleted, the form text "teleports" to a neighbor. Find the cause in the diff.
React uses `key` to understand which list elements were kept, added, or removed. It's called reconciliation. With correct keys, React reuses DOM correctly and keeps local state in children. Main rule: **a key must be a stable unique identifier of a specific element**, not of its position. Think about what wrong keys look like and hunt for them in the code.