Overview
Neexo projects default to Next.js 16 App Router patterns, server components, narrow TypeScript boundaries, and existing local UI conventions.
Server vs Client Components
- Prefer server components unless hooks, browser APIs, or event handlers require client components
- Keep server/client boundaries explicit — mark client components with
"use client"at the top - Use server actions for mutations; do not create API routes for simple form submissions
Next.js 16 Specifics
paramsandsearchParamsare now async in route components — alwaysawaitthem:export default async function Page({ params }: { params: Promise<{ slug: string }> }) { const { slug } = await params }cookies()andheaders()fromnext/headersare async —awaitbefore reading- Turbopack is the default bundler in development — do not add Webpack-specific config unless required for production
- Use the
usehook from React 19 to unwrap promises in client components - Use
"use cache"for fine-grained caching instead of relying solely on route segment config
TypeScript and Code Style
- Avoid
anyunless justified at an integration boundary - Reuse existing components, hooks, utilities, and design tokens
- Add dependencies only when the existing stack cannot reasonably solve the problem
- Prefer
satisfiesfor type narrowing of config objects
Patterns to Avoid
- Do not use
getServerSidePropsorgetStaticProps— these are Pages Router patterns - Do not wrap server components in unnecessary client wrappers
- Do not use
useEffectfor data fetching — fetch in server components or use server actions