// Before (Pages Router)export async function getServerSideProps(context) { const data = await fetchData(context.params.id); return { props: { data } };}// After (App Router) — just fetch in the componentexport default async function Page({ params }) { const data = await fetchData(params.id); return <div>{data.title}</div>;}
getStaticProps -> Server Component + cache
Use fetch with { cache: 'force-cache' } or { next: { revalidate: 60 } }
Or use unstable_cache for non-fetch data sources
Use generateStaticParams for getStaticPaths
Client-side data (useEffect + useState) -> Server Component or 'use client'
If data can be fetched at request time, use server component
If data needs real-time updates, use 'use client' with SWR/React Query
3. Component Classification
Determine for each component:
Server Component (default): No hooks, no browser APIs, no event handlers