nextjs

Next.js Defaults

Core Next.js patterns and conventions

JavaScript
framework
Default
Used by 2654 projects

Details

Language / Topic
javascriptJavaScript
Category
framework
Compatible Frameworks
nextjs

Rules

balanced

Next.js

- Use Server Components by default — add `'use client'` only for interactive components. Use `fetch()` in Server Components for data loading with automatic deduplication. Use the App Router (`app/` directory) for new projects.

Next.js

- Use Server Components by default — add `'use client'` only for interactive components. Use `fetch()` in Server Components for data loading with automatic deduplication. Use the App Router (`app/` directory) for new projects.
- Use `loading.tsx` and `error.tsx` for route-level loading/error states. Use `generateMetadata()` for dynamic SEO meta tags. Use Server Actions (`'use server'`) for mutations instead of API routes. Use `next/image` with `width`/`height` or `fill` for optimized images. Use `revalidatePath()` / `revalidateTag()` for targeted cache invalidation.