Files
main/awesome-cursor-rules-mdc/nextjs15-react19-vercelai-tailwind-cursorrules-prompt-file/next-js-15-async-request-api-rules.mdc
T
2025-02-17 17:50:15 +05:30

14 lines
462 B
Plaintext

---
description: Dictates how asynchronous requests should be handled within Next.js 15, specifically concerning runtime APIs.
globs: app/**/*
---
- Always use async versions of runtime APIs:
typescript
const cookieStore = await cookies()
const headersList = await headers()
const { isEnabled } = await draftMode()
- Handle async params in layouts/pages:
typescript
const params = await props.params
const searchParams = await props.searchParams