Hint
Pages Router = getServerSideProps/getStaticProps; App Router = RSC by default, layouts, streaming
Next.js 13+ introduced the App Router as a complete architectural shift:
| Feature | Pages Router | App Router |
|---|---|---|
| Default component type | Client component | Server component |
| Data fetching | getServerSideProps, getStaticProps | async/await in component |
| Layouts | _app.tsx + manual | layout.tsx nesting |
| Loading states | Manual | loading.tsx (Suspense) |
| Error handling | Manual | error.tsx (Error Boundary) |
| Streaming | ❌ | ✅ built-in |
// App Router — data fetching is just async/await
// app/users/page.tsx
async function UsersPage() {
const users = await fetch('/api/users').then(r => r.json());
return ;
}
// Pages Router equivalent
export async function getServerSideProps() {
const users = await fetch('/api/users').then(r => r.json());
return { props: { users } };
}
export default function UsersPage({ users }) {
return ;
}