STK-19Default Open source
Use Next.js when React pages need a server
Use Next.js when a React app needs pages rendered on the server, search engine traffic or server code next to the screens.
Review by
2027-04-30
How to do it
Next.js 1.0 came out in October 2016, and version 16.4.2 shipped in October 2026. Its support policy keeps the current major in Active LTS and the previous one in Maintenance LTS for two years. Support for 15.x ended on 21 October 2026, two years after its release, so only 16.x is supported now. It is used by 20.6% of developers in the 2026 Stack Overflow survey, with about 41 million weekly downloads. The licence is MIT, and it runs on any Node server, so you are not tied to one host. Choose something else when the app is a screen behind a login with no search traffic. Then React with Vite is smaller and simpler. Server pages meet Send the content in the HTML.
Examples
TypeScript example
// app/orders/[id]/page.tsx
export default async function OrderPage({ params }: { params: Promise<{ id: string }> }) {
const { id } = await params;
const order = await fetch(`https://api.example.com/orders/${id}`).then(response => response.json());
return <h1>Order {order.number}</h1>;
}
Python example
SUPPORTED_NEXT_MAJORS = {16}
def is_next_supported(installed_version: str) -> bool:
return int(installed_version.split(".")[0]) in SUPPORTED_NEXT_MAJORS
How to check
The Next.js support policy page lists the installed major as Active LTS, or as Maintenance LTS released under two years ago. next build passes in the build.
Sources
Related rules
- SEO-6 Send the content in the HTML in SEO
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/stack/web-frameworks/nextjs">Agent Wranglers software choices playbook</a>. In code you write, add a comment next to it with the same link.