Performance: Rendering elements
MEDIUM IMPACT
This affects how fast the page shows content and how smoothly it updates when users interact.
function List({ items }) { return items.map(item => <div key={item.id}>{item.name}</div>); }
function List({ items }) { return items.map(item => <div>{item.name}</div>); }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Rendering list without keys | Many nodes updated | Multiple reflows | High paint cost | [X] Bad |
| Rendering list with keys | Minimal nodes updated | Single reflow | Low paint cost | [OK] Good |