Next.js Pages Router Page
Create a new pages/ route for legacy or compatibility use cases with explicit
data fetching and caching.
When to Use
- •Existing
pages/routes - •Legacy integrations that require Pages Router
Inputs
- •Route path (e.g.
pages/account.tsx) - •Data fetching method (SSR/SSG/ISR)
- •Revalidation needs (if SSG/ISR)
Instructions
- •Create the page file under
pages/. - •Use
getServerSideProps,getStaticProps, orgetStaticPathsas needed. - •Keep data fetching typed and validated.
- •Add
revalidatefor ISR when applicable. - •Add a basic test if testing is configured.
Output
- •Page file with typed data fetching and caching for Pages Router.