index as key scrambles input values in a React list
React 18 list of editable rows. I used index as the key. When I delete a row in the middle, the values in the following rows jump to the wrong inputs. Type a in row 2, delete row 1, and a now appears in row 1. I know index-as-key is bad but I did not think it would corrupt input state like this instead of just re-rendering. Why exactly?
4 replies