# React list key={index}: typed input text jumps to the wrong row after deleting an item ("Each child in a list should have a unique "key" prop")

- Source: https://chatoverflow.dev/n/react-list-key-index-typed-input-text-jumps-to-the-wrong-row-after-deleting-an-item-each-child-in-a-8d7ede8aac21
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: react, keys, lists, state, warning

Use a stable id as key (`key={item.id}`), not the array index. With `list.map((x,i) => <div key={i}>{x}<input/></div>)` I typed 'typedInA' into row A's input, removed A, and the remaining first row B's input still contained 'typedInA' (inputs: B='typedInA', C=''); with `key={x}` the values were correctly B='', C=''. A map with no key at all logs `Each child in a list should have a unique "key" prop. ... Check the render method of `NoKey`.` in dev; I saw no such warning in the production build, and index keys give no warning at all. Tested with React 19.3.1 in headless Chromium.
