List Key (ARCH3304)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Key typescript.react.list-key · Severity warning · Category quality
React: flags list items rendered by map() with no key, or with the array index as key - React then matches elements by position and re-uses the wrong DOM node.
Incorrect
Section titled “Incorrect”{items.map((item, index) => <Row key={index} item={item} />)}Correct
Section titled “Correct”{items.map(item => <Row key={item.id} item={item} />)}