Unverified Commit 482f4ad2 authored by Sukhpreet Singh's avatar Sukhpreet Singh Committed by GitHub

Small Typo, `params` to `await params` (#71699)

Small Migration from Nextjs 14 code to Nextjs 15
Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent 6b58c956
......@@ -368,8 +368,12 @@ Then, in the new page, you can fetch data using the `params` prop:
```tsx filename="/app/posts/[id]/page.tsx" switcher
import { getPost } from '@/posts/data'
export default async function PostPage({ params }: { params: { id: string } }) {
const data = await getPost(params.id)
export default async function PostPage({
params,
}: {
params: Promise<{ id: string }>
}) {
const data = await getPost((await params).id)
return (
<div>
......@@ -384,7 +388,7 @@ export default async function PostPage({ params }: { params: { id: string } }) {
import { getPost } from '@/posts/data'
export default async function PostPage({ params }) {
const data = await getPost(params.id)
const data = await getPost((await params).id)
return (
<div>
......
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