# Suspense Slots Only Allow One Immediate Child ## Rule Both `#default` and `#fallback` slots of `` only allow for one immediate child node. Multiple root elements will cause unexpected behavior. ## Why This Matters Vue's Suspense needs to track a single root node to manage the pending/resolved state transitions. Multiple children in the default slot can cause rendering issues or the Suspense to not work correctly. ## Bad Code ```vue ``` ## Good Code ```vue ``` ## Alternative: Dedicated Layout Component ```vue ``` ```vue ``` ## Key Points 1. Always wrap multiple elements in a single container element 2. This applies to both `#default` and `#fallback` slots 3. Consider extracting complex layouts into dedicated components 4. The single-child requirement helps Vue track the component tree correctly ## References - [Vue.js Suspense Documentation](https://vuejs.org/guide/built-ins/suspense)