What Next.js rendering is and why it matters
Transpilation in Next.js
- ES6 → ES5 for old browsers
- JSX → JavaScript so browsers can read it
- TypeScript → JS before execution
Example of transpilation
// JSX
const App = () => <h1>Hello</h1>;
// after transpilation
const App = () => React.createElement("h1", null, "Hello");
You write the modern code, and Next.js automatically handles the rest.
CSR — Client Side Rendering
- Fast after load
- Not SEO-friendly
- First paint may feel slow
Simple CSR example
Create a component inside
use client:
"use client";
export default function Home() {
return <button>Click Me</button>;
}
SSR — Server Side Rendering
- Great for SEO
- Faster first paint
- More secure
Example of SSR (default in Next.js app router)
export default async function Page() {
const data = await fetch("https://api.example.com");
return <div>{JSON.stringify(data)}</div>;
}
Hydration explained
Think of it like:
- Server renders HTML
- Browser loads HTML
- React “wakes up” the page
CSR vs SSR in Next.js — quick comparison
| CSR | SSR |
|---|---|
| UI built on client | UI built on server |
| Slower first load | Fast first load |
| Not great for SEO | SEO-friendly |
| Useful for dashboards | Useful for blogs, product pages |
Real-world example: When to choose CSR or SSR
- Building dashboards
- Authenticated pages
- Frequent dynamic interactions
Use SSR when:
- Public content
- SEO-focused pages
- Blog posts and product listings
Conclusion — mastering Next.js rendering
- Transpilation converts modern code into browser-ready code.
- CSR builds the UI in the browser.
- SSR builds it on the server for better SEO and performance.
- Hydration turns HTML into a React-powered page.





