Skip to content

Commit

Permalink
fix(ssr): fix hydration error when teleport is used as component root
Browse files Browse the repository at this point in the history
fix #4293
  • Loading branch information
yyx990803 committed May 18, 2022
1 parent fd2aa12 commit b60cff0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/runtime-core/src/hydration.ts
Expand Up @@ -207,6 +207,15 @@ export function createHydrationFunctions(
? locateClosingAsyncAnchor(node)
: nextSibling(node)

// #4293 teleport as component root
if (
nextNode &&
isComment(nextNode) &&
nextNode.data === 'teleport end'
) {
nextNode = nextSibling(nextNode)
}

// #3787
// if component is async, it may get moved / unmounted before its
// inner component is loaded, so we need to give it a placeholder
Expand Down

0 comments on commit b60cff0

Please sign in to comment.