next.js
323ec0ae - docs: fix incorrect usage of Promise in page params example (#79804)

Commit
1 year ago
docs: fix incorrect usage of Promise in page params example (#79804) The documentation incorrectly used `params: Promise<{ slug: string }>` in an example and attempted to use `await` in a non-async function. This commit updates the example to reflect the correct usage: - `params` should be a synchronous object: `{ slug: string }` - The page component should be declared `async` if using `await` inside This fixes a misleading example and aligns it with actual behavior in the Next.js App Router: [cause]: SyntaxError: await is only valid in async functions and the top level bodies of modules ![image](https://github.com/user-attachments/assets/6ec80f29-9a03-4006-908f-c2d9e956064a) Co-authored-by: JJ Kasper <jj@jjsweb.site>
Author
Parents
Loading