Unverified Commit f8fddfa1 authored by LioRael's avatar LioRael Committed by GitHub

docs: add await before headers() and cookies() calls (#73315)

parent f5b88d91
......@@ -17,9 +17,9 @@ Example:
```diff filename="app/page.js"
import { cookies } from 'next/headers'
- const cookieStore = cookies()
export default function Page() {
+ const cookieStore = cookies()
- const cookieStore = await cookies()
export default async function Page() {
+ const cookieStore = await cookies()
return ...
}
```
......@@ -27,9 +27,9 @@ export default function Page() {
```diff filename="app/foo/route.js"
import { headers } from 'next/headers'
- const headersList = headers()
- const headersList = await headers()
export async function GET() {
+ const headersList = headers()
+ const headersList = await headers()
return ...
}
```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment