Nextjs

Next.js App Router rules and architecture.

LuisSambrano a6e2f08 472 B Updated

File contents

Next.js Protocol

Routing

  • Strictly use the app/ router.
  • Use loading.tsx and error.tsx for graceful degradation.

Data Fetching

  • Fetch data in Server Components (async function Page()).
  • Avoid useEffect for data fetching; use SWR or React Query only for mutations or real-time polling on the client.

Mutations

  • Use Server Actions for all POST/PUT/DELETE operations.

LuisSambrano/antigravity-config/tree/main/skills/web/nextjs commit a6e2f08590

Frequently asked questions

npx skillmds@latest add luissambrano/nextjs