Before jumping into writing Next.js code, it’s important to build a strong foundation. This foundation not only helps you write better applications but also helps you answer interview questions confidently and make smarter architectural decisions.
If your “why” isn’t clear, your “how” won’t make sense either. Without understanding the evolution of web technologies, you might even blame Next.js for things you don’t understand—only revealing a lack of knowledge.
So before we dive into coding, let’s travel through time and see how web development evolved from Vanilla JS → React → Next.js.
Before modern frameworks existed, websites were built using the fundamentals:
When a user visited a site:
The browser sent a request to the server.
The server responded with three files:
The browser:
For every new page, the cycle repeated: new request → new full HTML/CSS/JS files
Heavy client-side processing Slower devices struggled when the browser had to handle large amounts of HTML and JavaScript.
High bandwidth usage Every page load required downloading complete files again.
Slow initial load The user sees nothing until the browser receives and processes everything.
This worked fine for simple sites—but it didn’t scale well as websites grew more interactive.
React revolutionized UI development with:
When you visit a React app:
The client requests the site content.
The server returns:
React uses this JavaScript to:
React Router handles navigation internally, allowing transitions without page refreshes.
Complexity Components, props, state management, bundling, routing, tooling—there’s a learning curve.
Client-heavy rendering Everything depends on JavaScript. On slow devices, rendering becomes sluggish.
SEO limitations Search engines struggle with JavaScript-generated content.
React gave developers a powerful way to build apps, but it didn’t solve everything.
Next.js blends the strengths of both traditional rendering and React.
The biggest innovation? ➡️ You choose where your page is rendered — on the server or in the client.
When a user visits a Next.js site:
The client sends a request.
Next.js starts executing React components on the server.
It generates:
The server sends back fully rendered HTML. The user sees the page instantly.
Then:
Hydration = attaching interactivity to HTML rendered on the server.
If the HTML on the server doesn’t match what React expects on the client, you get the infamous hydration error.
Next.js manages this process for you, but mismatches can still happen if components behave differently across server and client.
Next.js gives developers control:
This flexibility lets you:
Next.js is a modern hybrid framework that adapts to your app’s needs.