React
React Lists and KeysReact Lists and Keys
React renders lists of data dynamically using arrays.
Read Time
5 min readDifficulty
BeginnerLast Updated
Jun 15, 2026Version
v1.0.0Introduction
When developers have an array of data, like ten different blog posts, they don't write the HTML ten times. Instead, they use the JavaScript `map()` method to loop through the array and render a component for every single item automatically.
Example
Example
Key Points
- The `map()` method loops over an array of data.
- Every item in a list must have a unique `key` prop.
- The `key` helps React update the list efficiently.
- Do not use the array index as a key if the list can change.