Skip to content
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

docs: misc typo corrections in upgrade guide & codemod #71098

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
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 @@ -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
Loading