@@ -61,9 +61,8 @@ const vaporInteropImpl: Omit<
6161 'vdomMount' | 'vdomUnmount' | 'vdomSlot'
6262> = {
6363 mount ( vnode , container , anchor , parentComponent ) {
64- let selfAnchor : Node | null = null
64+ let selfAnchor = ( vnode . el = vnode . anchor = createTextNode ( ) )
6565 if ( ! isHydrating ) {
66- selfAnchor = vnode . el = vnode . anchor = createTextNode ( )
6766 container . insertBefore ( selfAnchor , anchor )
6867 }
6968 const prev = currentInstance
@@ -91,6 +90,12 @@ const vaporInteropImpl: Omit<
9190 ) )
9291 instance . rawPropsRef = propsRef
9392 instance . rawSlotsRef = slotsRef
93+ if ( isHydrating ) {
94+ // insert self anchor after hydration completed to avoid mismatching
95+ ; ( instance . m || ( instance . m = [ ] ) ) . push ( ( ) => {
96+ container . insertBefore ( selfAnchor , anchor )
97+ } )
98+ }
9499 mountComponent ( instance , container , selfAnchor )
95100 simpleSetCurrentInstance ( prev )
96101 return instance
@@ -113,7 +118,7 @@ const vaporInteropImpl: Omit<
113118 } else if ( vnode . vb ) {
114119 remove ( vnode . vb , container )
115120 }
116- if ( vnode . anchor ) remove ( vnode . anchor as Node , container )
121+ remove ( vnode . anchor as Node , container )
117122 } ,
118123
119124 /**
0 commit comments