Skip to content

Commit 109d1d8

Browse files
committed
fix(teleport): avoid infinite recursion in process when teleport is deferred
1 parent 163b365 commit 109d1d8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/runtime-core/src/components/Teleport.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ export const TeleportImpl = {
164164
}
165165

166166
if (isTeleportDeferred(n2.props)) {
167+
n2.el!.__isMounted = false
167168
queuePostRenderEffect(() => {
168169
mountToTarget()
169170
n2.el!.__isMounted = true
@@ -172,7 +173,7 @@ export const TeleportImpl = {
172173
mountToTarget()
173174
}
174175
} else {
175-
if (isTeleportDeferred(n2.props) && !n1.el!.__isMounted) {
176+
if (isTeleportDeferred(n2.props) && n1.el!.__isMounted === false) {
176177
queuePostRenderEffect(() => {
177178
TeleportImpl.process(
178179
n1,

0 commit comments

Comments
 (0)