File tree 2 files changed +34
-1
lines changed
2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -1613,6 +1613,36 @@ describe('SSR hydration', () => {
1613
1613
` )
1614
1614
} )
1615
1615
1616
+ test ( 'Suspense + transition appear' , async ( ) => {
1617
+ const { vnode, container } = mountWithHydration (
1618
+ `<template><div>foo</div></template>` ,
1619
+ ( ) =>
1620
+ h ( Suspense , { } , ( ) =>
1621
+ h (
1622
+ Transition ,
1623
+ { appear : true } ,
1624
+ {
1625
+ default : ( ) => h ( 'div' , 'foo' ) ,
1626
+ } ,
1627
+ ) ,
1628
+ ) ,
1629
+ )
1630
+
1631
+ expect ( vnode . el ) . toBe ( container . firstChild )
1632
+ // wait for hydration to finish
1633
+ await new Promise ( r => setTimeout ( r ) )
1634
+
1635
+ expect ( container . firstChild ) . toMatchInlineSnapshot ( `
1636
+ <div
1637
+ class="v-enter-from v-enter-active"
1638
+ >
1639
+ foo
1640
+ </div>
1641
+ ` )
1642
+ await nextTick ( )
1643
+ expect ( vnode . el ) . toBe ( container . firstChild )
1644
+ } )
1645
+
1616
1646
// #10607
1617
1647
test ( 'update component stable slot (prod + optimized mode)' , async ( ) => {
1618
1648
__DEV__ = false
Original file line number Diff line number Diff line change @@ -385,7 +385,10 @@ export function createHydrationFunctions(
385
385
let needCallTransitionHooks = false
386
386
if ( isTemplateNode ( el ) ) {
387
387
needCallTransitionHooks =
388
- needTransition ( parentSuspense , transition ) &&
388
+ needTransition (
389
+ null , // no need check parentSuspense in hydration
390
+ transition ,
391
+ ) &&
389
392
parentComponent &&
390
393
parentComponent . vnode . props &&
391
394
parentComponent . vnode . props . appear
You can’t perform that action at this time.
0 commit comments