Vue · Senior · Question 22 of 75
What does lazy hydration in Vue 3.5 enable?
const Comments = defineAsyncComponent({
loader: () => import("./Comments.vue"),
hydrate: hydrateOnVisible(),
});- ✓Correct answer: Server-rendered async components are hydrated only when a condition is met, e.g. becoming visible
- 2Components are rendered only on the client
- 3Hydration happens in a Web Worker
Explanation
Other strategies include hydrateOnIdle, hydrateOnInteraction and hydrateOnMediaQuery. The HTML is visible immediately, but JS for below-the-fold parts loads later.