Skip to content

Commit

Permalink
docs: update code snippet for correct file name (#56006)
Browse files Browse the repository at this point in the history
params would be undefined on the /item route, i believe the route should be /item/[id]
  • Loading branch information
2XG-DEV authored Oct 7, 2023
1 parent 82c095f commit 06ee9d7
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 06ee9d7

Please sign in to comment.