Next.js에는 두 가지 routing 시스템이 있습니다. Pages Router(pages/)는 원래의 방식이고, App Router(app/, Next 13부터)는 React Server Components를 중심으로 만들어진 더 새롭고 권장되는 방식입니다.
파일과 컨벤션의 차이
text
Pages Router (pages/) App Router (app/)
──────────────────────────────────────────────────────
pages/about.tsx → /about app/about/page.tsx → /about
기본 export = 페이지 page.tsx = 페이지, layout.tsx = 레이아웃
getServerSideProps (SSR) async Server Component (직접 fetch)
getStaticProps (SSG) 캐싱 옵션이 있는 fetch()
_app.tsx / _document.tsx 중첩된 layout.tsx 파일들
모든 컴포넌트가 클라이언트 렌더링 기본적으로 Server Component
