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:
parent
f6d9c512fa
commit
445cc62b3e
1 changed files with 3 additions and 5 deletions
|
@ -14,19 +14,17 @@ Make sure that all Dynamic API calls happen in a request scope.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
```diff
|
```jsx filename="app/page.js"
|
||||||
// app/page.ts
|
|
||||||
import { cookies } from 'next/headers'
|
import { cookies } from 'next/headers'
|
||||||
|
|
||||||
- const cookieStore = cookies()
|
- const cookieStore = cookies()
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
+ const cookieStore = cookies()
|
+ const cookieStore = cookies()
|
||||||
return ...
|
return ...
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
```diff
|
```jsx filename="app/foo/route.js"
|
||||||
// app/foo/route.ts
|
|
||||||
import { headers } from 'next/headers'
|
import { headers } from 'next/headers'
|
||||||
|
|
||||||
- const headersList = headers()
|
- const headersList = headers()
|
||||||
|
|
Loading…
Reference in a new issue