Skip to content

Commit

Permalink
fix(runtime-core): do not call transition enter hooks when mounting i…
Browse files Browse the repository at this point in the history
…n suspense (#1588)

fix #1583
  • Loading branch information
underfin committed Jul 15, 2020
1 parent 64c7b2f commit 246ec5c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/runtime-core/src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -736,14 +736,17 @@ function baseCreateRenderer(
}

hostInsert(el, container, anchor)
// #1583 For inside suspense case, enter hook should call when suspense resolved
const needCallTransitionHooks =
!parentSuspense && transition && !transition.persisted
if (
(vnodeHook = props && props.onVnodeMounted) ||
(transition && !transition.persisted) ||
needCallTransitionHooks ||
dirs
) {
queuePostRenderEffect(() => {
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode)
transition && !transition.persisted && transition.enter(el)
needCallTransitionHooks && transition!.enter(el)
dirs && invokeDirectiveHook(vnode, null, parentComponent, 'mounted')
}, parentSuspense)
}
Expand Down

0 comments on commit 246ec5c

Please sign in to comment.