--- title: TransitionGroup No Longer Renders Default Wrapper Element in Vue 3 impact: MEDIUM impactDescription: Vue 2 to Vue 3 migration may break layouts relying on the default span wrapper type: gotcha tags: [vue3, transition-group, migration, vue2, breaking-change, wrapper-element] --- # TransitionGroup No Longer Renders Default Wrapper Element in Vue 3 **Impact: MEDIUM** - In Vue 2, `` always rendered a wrapper element (default ``), but in Vue 3, it renders no wrapper element by default thanks to fragment support. This breaking change can cause layout issues and broken styles when migrating from Vue 2. If your code relies on the wrapper element for styling or layout, you must explicitly specify the `tag` prop in Vue 3. ## Task Checklist - [ ] When migrating from Vue 2, add explicit `tag` prop to all `` components - [ ] Review CSS selectors that targeted the wrapper element - [ ] Update parent component styles that expected a wrapper element - [ ] Consider if the wrapper element is actually needed in Vue 3 **Vue 2 Behavior (wrapper element by default):** ```vue
Item 1
Item 2
``` **Vue 3 Behavior (no wrapper by default):** ```vue
Item 1
Item 2
``` **Vue 3 - Explicitly specify wrapper:** ```vue
  • Item 1
  • Item 2
``` ## Migration Scenarios ### Layout Depending on Wrapper **Vue 2 code that breaks in Vue 3:** ```vue ``` In Vue 3, the class is not applied to anything because there's no wrapper element. **Fixed for Vue 3:** ```vue ``` ### Semantic HTML Lists **Vue 2:** ```vue
  • {{ item }}
  • ``` **Vue 3 (same syntax, but now tag is more important):** ```vue
  • {{ item }}
  • ``` ### When You Don't Need a Wrapper Vue 3's fragment support means you might not need a wrapper at all: ```vue ``` ## In-DOM Template Syntax When using in-DOM templates (not SFCs), remember to use kebab-case: ```html
  • {{ item }}
  • ``` ## Reference - [Vue 3 Migration Guide - TransitionGroup Root Element](https://v3-migration.vuejs.org/breaking-changes/transition-group.html) - [Vue.js TransitionGroup](https://vuejs.org/guide/built-ins/transition-group.html)