{"library":"next","title":"Next.js React Framework","description":"Next.js is an open-source React framework designed for building performant and scalable web applications. It supports a variety of rendering strategies, including Server-Side Rendering (SSR), Static Site Generation (SSG), Incremental Static Regeneration (ISR), and client-side rendering. The current stable version is 16.2.4. Next.js typically releases new features and major architectural changes, like the App Router and React Server Components, in frequent canary and beta channels, with stable versions receiving backported bug fixes and optimizations. Key differentiators include its file-system-based routing, built-in image and font optimization, API routes for backend functionality, and deep integration with React Server Components for a full-stack development experience. It aims to provide a complete solution for React applications, abstracting much of the build configuration and deployment complexities.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install next"],"cli":null},"imports":["import Image from 'next/image';","import { useRouter } from 'next/navigation'; // App Router\nimport { useRouter } from 'next/router'; // Pages Router","import { NextResponse } from 'next/server';","import Link from 'next/link';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import Link from 'next/link';\nimport { NextResponse } from 'next/server';\n\n// app/api/hello/route.ts (App Router API Route Handler)\nexport async function GET(request: Request) {\n  const { searchParams } = new URL(request.url);\n  const name = searchParams.get('name') || 'World';\n  // In a real app, you might fetch data from a database or another API\n  const data = await Promise.resolve({ message: `Hello, ${name}!` });\n  return NextResponse.json(data);\n}\n\n// app/page.tsx (App Router Page Component)\nexport default function HomePage() {\n  return (\n    <div>\n      <h1>Welcome to Next.js!</h1>\n      <p>This is a simple homepage.</p>\n      <Link href=\"/about\">\n        Go to About Page\n      </Link>\n      <p>Try fetching an API route: <a href=\"/api/hello?name=Registry\">/api/hello?name=Registry</a></p>\n    </div>\n  );\n}\n\n// app/about/page.tsx (App Router Page Component)\nexport default function AboutPage() {\n  return (\n    <div>\n      <h1>About Us</h1>\n      <p>Learn more about this Next.js application.</p>\n      <Link href=\"/\">\n        Go to Home\n      </Link>\n    </div>\n  );\n}\n\n// To set up a new Next.js project, run:\n// npx create-next-app@latest my-app --typescript --app --eslint\n// Then, create the files above inside the `my-app` directory.","lang":"typescript","description":"Demonstrates a basic Next.js App Router setup with a homepage, an about page with client-side navigation using `Link`, and a simple API Route Handler (`app/api/hello/route.ts`) to fetch dynamic data.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}