File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed
packages/runtime-core/src Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -123,28 +123,28 @@ export function defineAsyncComponent<
123
123
124
124
__asyncHydrate ( el , instance , hydrate ) {
125
125
let patched = false
126
+ ; ( instance . bu || ( instance . bu = [ ] ) ) . push ( ( ) => ( patched = true ) )
127
+ const performHydrate = ( ) => {
128
+ // skip hydration if the component has been patched
129
+ if ( __DEV__ && patched ) {
130
+ warn (
131
+ `Skipping lazy hydration for component '${ getComponentName ( resolvedComp ! ) || resolvedComp ! . __file } ': ` +
132
+ `it was updated before lazy hydration performed.` ,
133
+ )
134
+ return
135
+ }
136
+ hydrate ( )
137
+ }
126
138
const doHydrate = hydrateStrategy
127
139
? ( ) => {
128
- const performHydrate = ( ) => {
129
- // skip hydration if the component has been patched
130
- if ( __DEV__ && patched ) {
131
- warn (
132
- `Skipping lazy hydration for component '${ getComponentName ( resolvedComp ! ) } ': ` +
133
- `it was updated before lazy hydration performed.` ,
134
- )
135
- return
136
- }
137
- hydrate ( )
138
- }
139
140
const teardown = hydrateStrategy ( performHydrate , cb =>
140
141
forEachElement ( el , cb ) ,
141
142
)
142
143
if ( teardown ) {
143
144
; ( instance . bum || ( instance . bum = [ ] ) ) . push ( teardown )
144
145
}
145
- ; ( instance . u || ( instance . u = [ ] ) ) . push ( ( ) => ( patched = true ) )
146
146
}
147
- : hydrate
147
+ : performHydrate
148
148
if ( resolvedComp ) {
149
149
doHydrate ( )
150
150
} else {
You can’t perform that action at this time.
0 commit comments