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: ...@@ -17,9 +17,9 @@ Example:
```diff filename="app/page.js" ```diff filename="app/page.js"
import { cookies } from 'next/headers' import { cookies } from 'next/headers'
- const cookieStore = cookies() - const cookieStore = await cookies()
export default function Page() { export default async function Page() {
+ const cookieStore = cookies() + const cookieStore = await cookies()
return ... return ...
} }
``` ```
...@@ -27,9 +27,9 @@ export default function Page() { ...@@ -27,9 +27,9 @@ export default function Page() {
```diff filename="app/foo/route.js" ```diff filename="app/foo/route.js"
import { headers } from 'next/headers' import { headers } from 'next/headers'
- const headersList = headers() - const headersList = await headers()
export async function GET() { export async function GET() {
+ const headersList = headers() + const headersList = await headers()
return ... 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