Skip to content

Commit

Permalink
docs: misc typo corrections in upgrade guide & codemod (#71098)
Browse files Browse the repository at this point in the history
Caught these when reviewing the published changes.
  • Loading branch information
ztanner authored Oct 10, 2024
1 parent d9a9a5d commit 61f5b95
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const runtime = 'edge'

#### Migrate to async Dynamic APIs

APIs that opted into dynamic rendering that previously supported synchronous access are now asynchronous. You can read more about this breaking change in the [upgrade guide](/docs/app/building-your-application/upgrading/version-15)
APIs that opted into dynamic rendering that previously supported synchronous access are now asynchronous. You can read more about this breaking change in the [upgrade guide](/docs/app/building-your-application/upgrading/version-15).

##### `next-async-request-api`

Expand Down Expand Up @@ -117,7 +117,7 @@ export default function Page({
searchParams,
}: {
params: { slug: string }
searchParams: { [key: string]: string | undefined }
searchParams: { [key: string]: string | string[] | undefined }
}) {
const { value } = searchParams
if (value === 'foo') {
Expand All @@ -138,7 +138,7 @@ Transforms into:
// page.tsx
export default function Page(props: {
params: { slug: string }
searchParams: { [key: string]: string | undefined }
searchParams: { [key: string]: string | string[] | undefined }
}) {
const { value } = await props.searchParams
if (value === 'foo') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export default async function Layout({
children: React.ReactNode
params: Params
}) {
const { slug } = await props
const { slug } = await params
}
```

Expand Down
2 changes: 1 addition & 1 deletion errors/sync-dynamic-apis.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Dynamic APIs are:
- The `params` and `searchParams` props that get provided to pages, layouts, metadata APIs, and route handlers.
- `cookies()`, `draftMode()`, and `headers()` from `next/headers`

In Next 15, these APIs have been made asynchronous. You can read more about this in the Next.js 15 [Upgrade Guide](/docs/app/building-your-application/upgrading/version-15)
In Next 15, these APIs have been made asynchronous. You can read more about this in the Next.js 15 [Upgrade Guide](/docs/app/building-your-application/upgrading/version-15).

For example, the following code will issue a warning:

Expand Down

0 comments on commit 61f5b95

Please sign in to comment.