Skip to content

docs: update code snippet for correct file name #56006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Oct 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ export const getItem = cache(async (id) => {

Although the `getItem` function is called twice, only one query will be made to the database.

```tsx filename="app/item/layout.tsx" switcher
```tsx filename="app/item/[id]/layout.tsx" switcher
import { getItem } from '@/utils/get-item'

export default async function Layout({
Expand All @@ -323,7 +323,7 @@ export default async function Layout({
}
```

```jsx filename="app/item/layout.js" switcher
```jsx filename="app/item/[id]/layout.js" switcher
import { getItem } from '@/utils/get-item'

export default async function Layout({ params: { id } }) {
Expand Down