fix(ssr): ensure app can be unmounted when created with createSSRApp() (#5992)
fix #5990
This commit is contained in:
@@ -27,7 +27,7 @@ import { isAsyncWrapper } from './apiAsyncComponent'
|
||||
|
||||
export type RootHydrateFunction = (
|
||||
vnode: VNode<Node, Element>,
|
||||
container: Element | ShadowRoot
|
||||
container: (Element | ShadowRoot) & { _vnode?: VNode }
|
||||
) => void
|
||||
|
||||
const enum DOMNodeTypes {
|
||||
@@ -75,11 +75,13 @@ export function createHydrationFunctions(
|
||||
)
|
||||
patch(null, vnode, container)
|
||||
flushPostFlushCbs()
|
||||
container._vnode = vnode
|
||||
return
|
||||
}
|
||||
hasMismatch = false
|
||||
hydrateNode(container.firstChild!, vnode, null, null, null)
|
||||
flushPostFlushCbs()
|
||||
container._vnode = vnode
|
||||
if (hasMismatch && !__TEST__) {
|
||||
// this error should show up in production
|
||||
console.error(`Hydration completed but contains mismatches.`)
|
||||
|
||||
Reference in New Issue
Block a user