docs: update code block filename in dynamic API context error page (#67000)

The filenames of the two code blocks on this page
https://nextjs.org/docs/messages/next-dynamic-api-wrong-context are
written as comment instead of using the `filename` prop.


![image](https://github.com/vercel/next.js/assets/20135478/86b45742-cb83-4cd1-933c-a1c22f51e0fd)

---------

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Co-authored-by: Sam Ko <sam@vercel.com>
This commit is contained in:
Eng Zer Jun 2024-06-19 18:20:30 +08:00 committed by GitHub
parent f6d9c512fa
commit 445cc62b3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,19 +14,17 @@ Make sure that all Dynamic API calls happen in a request scope.
Example:
```diff
// app/page.ts
```jsx filename="app/page.js"
import { cookies } from 'next/headers'
- const cookieStore = cookies()
- const cookieStore = cookies()
export default function Page() {
+ const cookieStore = cookies()
return ...
}
```
```diff
// app/foo/route.ts
```jsx filename="app/foo/route.js"
import { headers } from 'next/headers'
- const headersList = headers()