Performance: TransitionGroup for lists
MEDIUM IMPACT
This affects the rendering performance and visual stability when animating list items during addition, removal, or reordering.
<TransitionGroup tag="ul" name="fade" appear> <li v-for="item in items" :key="item.id">{{ item.text }}</li> </TransitionGroup>
<ul> <li v-for="item in items" :key="item.id">{{ item.text }}</li> </ul>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| List without TransitionGroup | Minimal DOM ops, direct add/remove | Multiple reflows per item change | High paint cost due to abrupt changes | [X] Bad |
| List with TransitionGroup and CSS transitions | Same DOM ops plus animation wrappers | Single reflow with animated layout shifts | Moderate paint cost with smooth transitions | [OK] Good |