__asyncHydrate(el, instance, hydrate) {
let patched = false
+ ;(instance.bu || (instance.bu = [])).push(() => (patched = true))
+ const performHydrate = () => {
+ // skip hydration if the component has been patched
+ if (__DEV__ && patched) {
+ warn(
+ `Skipping lazy hydration for component '${getComponentName(resolvedComp!) || resolvedComp!.__file}': ` +
+ `it was updated before lazy hydration performed.`,
+ )
+ return
+ }
+ hydrate()
+ }
const doHydrate = hydrateStrategy
? () => {
- const performHydrate = () => {
- // skip hydration if the component has been patched
- if (__DEV__ && patched) {
- warn(
- `Skipping lazy hydration for component '${getComponentName(resolvedComp!)}': ` +
- `it was updated before lazy hydration performed.`,
- )
- return
- }
- hydrate()
- }
const teardown = hydrateStrategy(performHydrate, cb =>
forEachElement(el, cb),
)
if (teardown) {
;(instance.bum || (instance.bum = [])).push(teardown)
}
- ;(instance.u || (instance.u = [])).push(() => (patched = true))
}
- : hydrate
+ : performHydrate
if (resolvedComp) {
doHydrate()
} else {