@@ -306,23 +306,21 @@ export function findTransitionBlock(
306306 // use component id as key
307307 if ( child && child . $key === undefined ) child . $key = block . uid
308308 } else if ( isArray ( block ) ) {
309- child = block [ 0 ] as TransitionBlock
310309 let hasFound = false
311310 for ( const c of block ) {
311+ if ( c instanceof Comment ) continue
312312 const item = findTransitionBlock ( c )
313- if ( item instanceof Element ) {
314- if ( __DEV__ && hasFound ) {
315- // warn more than one non-comment child
316- warn (
317- '<transition> can only be used on a single element or component. ' +
318- 'Use <transition-group> for lists.' ,
319- )
320- break
321- }
322- child = item
323- hasFound = true
324- if ( ! __DEV__ ) break
313+ if ( __DEV__ && hasFound ) {
314+ // warn more than one non-comment child
315+ warn (
316+ '<transition> can only be used on a single element or component. ' +
317+ 'Use <transition-group> for lists.' ,
318+ )
319+ break
325320 }
321+ child = item
322+ hasFound = true
323+ if ( ! __DEV__ ) break
326324 }
327325 } else if ( ( isFrag = isFragment ( block ) ) ) {
328326 if ( block . insert ) {
@@ -344,7 +342,7 @@ export function setTransitionHooksOnFragment(
344342 hooks : VaporTransitionHooks ,
345343) : void {
346344 if ( isFragment ( block ) ) {
347- setTransitionHooks ( block , hooks )
345+ block . $transition = hooks
348346 } else if ( isArray ( block ) ) {
349347 for ( let i = 0 ; i < block . length ; i ++ ) {
350348 setTransitionHooksOnFragment ( block [ i ] , hooks )
0 commit comments