@@ -72,6 +72,7 @@ import { initFeatureFlags } from './featureFlags'
72
72
import { isAsyncWrapper } from './apiAsyncComponent'
73
73
import { isCompatEnabled } from './compat/compatConfig'
74
74
import { DeprecationTypes } from './compat/compatConfig'
75
+ import { TransitionHooks } from './components/BaseTransition'
75
76
76
77
export interface Renderer < HostElement = RendererElement > {
77
78
render : RootRenderFunction < HostElement >
@@ -701,10 +702,7 @@ function baseCreateRenderer(
701
702
}
702
703
// #1583 For inside suspense + suspense not resolved case, enter hook should call when suspense resolved
703
704
// #1689 For inside suspense + suspense resolved case, just call it
704
- const needCallTransitionHooks =
705
- ( ! parentSuspense || ( parentSuspense && ! parentSuspense . pendingBranch ) ) &&
706
- transition &&
707
- ! transition . persisted
705
+ const needCallTransitionHooks = needTransition ( parentSuspense , transition )
708
706
if ( needCallTransitionHooks ) {
709
707
transition ! . beforeEnter ( el )
710
708
}
@@ -2365,6 +2363,17 @@ function toggleRecurse(
2365
2363
effect . allowRecurse = update . allowRecurse = allowed
2366
2364
}
2367
2365
2366
+ export function needTransition (
2367
+ parentSuspense : SuspenseBoundary | null ,
2368
+ transition : TransitionHooks | null
2369
+ ) {
2370
+ return (
2371
+ ( ! parentSuspense || ( parentSuspense && ! parentSuspense . pendingBranch ) ) &&
2372
+ transition &&
2373
+ ! transition . persisted
2374
+ )
2375
+ }
2376
+
2368
2377
/**
2369
2378
* #1156
2370
2379
* When a component is HMR-enabled, we need to make sure that all static nodes
0 commit comments