Skip to content

Instantly share code, notes, and snippets.

@digitarald
Created August 27, 2024 00:30
Show Gist options
  • Save digitarald/6f76a290e52875d08bf269833b737274 to your computer and use it in GitHub Desktop.
Save digitarald/6f76a290e52875d08bf269833b737274 to your computer and use it in GitHub Desktop.
Next.JS App Router - Copilot Custom Instructions
  • Default to Server Components in app/, only using Client Components with 'use client' if they use hooks like useState or useRouter, or DOM interactions.
  • Fetching data in Server Components: use fetch(), avoid useEffect.
  • For TypeScript: Enforce interfaces and types for all props and state.
  • Nest layout.tsx files for consistent UI across sections.
  • For async operations: prefer async/await, add appropriate error handling and UI loading states.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment