ducdoanh.info — Visual Studio Code
pages-router-notes.md
UTF-8 · LF

Pages Router notes (Next 16)

Things I check before writing Pages Router code on Next 16.

Next 16 still ships the Pages Router and getStaticProps / getStaticPaths, but the local AGENTS.md warns that conventions and APIs may differ from older training data. Before each new page I open node_modules/next/dist/docs/02-pages/ and confirm the exact shape.

What I keep using

  • import Head from "next/head" for per-page meta.
  • import Link from "next/link" — no <a> child needed for plain text.
  • export const getStaticProps = (async () => { ... }) satisfies GetStaticProps — keeps types tight without an explicit return annotation.
  • next/font/google for Geist + Geist Mono.

Watch out for

  • Default eslint-config-next rules ban javascript: hrefs and unkeyed lists.
  • next/image still wants explicit width/height for static images.