Skip to content

Commit bc6f252

Browse files
authored
fix(runtime-core): should correctly call beforeEnter inside Suspense (#1805)
fix #1795
1 parent 3991ff0 commit bc6f252

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/runtime-core/src/renderer.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -752,19 +752,17 @@ function baseCreateRenderer(
752752
if (treeOwnerId && treeOwnerId !== scopeId) {
753753
hostSetScopeId(el, treeOwnerId + '-s')
754754
}
755-
756-
if (transition && !transition.persisted) {
757-
transition.beforeEnter(el)
758-
}
759755
}
760-
761-
hostInsert(el, container, anchor)
762756
// #1583 For inside suspense + suspense not resolved case, enter hook should call when suspense resolved
763757
// #1689 For inside suspense + suspense resolved case, just call it
764758
const needCallTransitionHooks =
765759
(!parentSuspense || (parentSuspense && parentSuspense!.isResolved)) &&
766760
transition &&
767761
!transition.persisted
762+
if (needCallTransitionHooks) {
763+
transition!.beforeEnter(el)
764+
}
765+
hostInsert(el, container, anchor)
768766
if (
769767
(vnodeHook = props && props.onVnodeMounted) ||
770768
needCallTransitionHooks ||

0 commit comments

Comments
 (0)