The Hydration Problem
React SSR sends HTML, then re-executes ALL JavaScript to make it interactive. A complex page? 2-5 seconds of hydration where buttons don't work.
Qwik never hydrates. It sends HTML with tiny event listeners. JavaScript loads only when the user interacts — and only the code for THAT interaction.
What Qwik Gives You
Resumability Instead of Hydration
import { component$, useSignal } from '@builder.io/qwik';
export const Counter = component$(() => {
const count = useSignal(0);
return (
<button onClick$={() => count.value++}>
Count: {count.value}
</button>
);
});
The $ suffix marks lazy-loading boundaries. This button's click handler loads ONLY when clicked.
Automatic Code Splitting
Every $ function is a separate chunk:
-
onClick$→ loads on click -
useVisibleTask$→ loads when element is visible -
useTask$→ loads on server
You don't configure code splitting. Qwik does it automatically at the function level.
Server Functions
import { routeLoader$ } from '@builder.io/qwik-city';
export const useProducts = routeLoader$(async () => {
const products = await db.products.findMany();
return products;
});
export default component$(() => {
const products = useProducts();
return (
<ul>
{products.value.map(p => <li key={p.id}>{p.name}</li>)}
</ul>
);
});
Forms (Server Actions)
import { routeAction$, Form } from '@builder.io/qwik-city';
export const useAddItem = routeAction$(async (data) => {
await db.items.create({ name: data.name });
return { success: true };
});
export default component$(() => {
const action = useAddItem();
return (
<Form action={action}>
<input name="name" />
<button type="submit">Add</button>
</Form>
);
});
Performance
| Metric | React (Next.js) | Qwik |
|---|---|---|
| JS sent on load | 200-500KB | <5KB |
| Time to Interactive | 2-5s | <0.5s |
| Hydration time | 1-3s | 0s |
Quick Start
npm create qwik@latest
cd my-app
npm start
Why This Matters
Hydration is a workaround, not a solution. Qwik proves that web apps can be interactive instantly — with zero JavaScript on initial load.
Building data-driven Qwik apps? Check out my web scraping actors on Apify Store — instant data for instant apps. For custom solutions, email spinov001@gmail.com.
Top comments (0)