Skip to content

Commit

Permalink
fix(ssr): ensure behavior consistency between prod/dev when mounting …
Browse files Browse the repository at this point in the history
…SSR app to empty containers

close #4034
  • Loading branch information
yyx990803 committed Jul 1, 2021
1 parent 34d4991 commit 33708e8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/runtime-core/src/hydration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ export function createHydrationFunctions(
} = rendererInternals

const hydrate: RootHydrateFunction = (vnode, container) => {
if (__DEV__ && !container.hasChildNodes()) {
warn(
`Attempting to hydrate existing markup but container is empty. ` +
`Performing full mount instead.`
)
if (!container.hasChildNodes()) {
__DEV__ &&
warn(
`Attempting to hydrate existing markup but container is empty. ` +
`Performing full mount instead.`
)
patch(null, vnode, container)
flushPostFlushCbs()
return
}
hasMismatch = false
Expand Down

0 comments on commit 33708e8

Please sign in to comment.