Skip to content

Conversation

@asedii
Copy link

@asedii asedii commented Oct 24, 2025

No description provided.

@ijjk ijjk added the Documentation Related to Next.js' official documentation. label Oct 24, 2025
@ijjk
Copy link
Member

ijjk commented Oct 24, 2025

Allow CI Workflow Run

  • approve CI run for commit: 7594505

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

<h1>This will be pre-rendered</h1>
<Suspense fallback={<TableSkeleton />}>
<Table searchParams={searchParams.then((search) => search.sort)} />
<Table sortPromise={searchParams.then((search) => search.sort)} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TypeScript code example uses the wrong prop name searchParams when it should be sortPromise to match the Table component's interface and the JavaScript example below it.

View Details
📝 Patch Details
diff --git a/docs/01-app/01-getting-started/06-cache-components.mdx b/docs/01-app/01-getting-started/06-cache-components.mdx
index 95c9324615..1d2f77ec25 100644
--- a/docs/01-app/01-getting-started/06-cache-components.mdx
+++ b/docs/01-app/01-getting-started/06-cache-components.mdx
@@ -522,7 +522,7 @@ export default function Page({
     <section>
       <h1>This will be pre-rendered</h1>
       <Suspense fallback={<TableSkeleton />}>
-        <Table searchParams={searchParams.then((search) => search.sort)} />
+        <Table sortPromise={searchParams.then((search) => search.sort)} />
       </Suspense>
     </section>
   )

Analysis

TypeScript code example uses incorrect prop name in Table component

What fails: The TypeScript code example at line 525 in docs/01-app/01-getting-started/06-cache-components.mdx passes searchParams prop to the <Table /> component, but the Table component interface (defined at lines 551 and 558) expects sortPromise prop. Developers copying the TypeScript example would get a type error and runtime failure.

How to reproduce:

  1. Copy the TypeScript code example from lines 514-532 (the <Table searchParams={...} /> version)
  2. Use it with the Table component defined at lines 547-560
  3. TypeScript type checker will report an error: property sortPromise is missing in the <Table /> component props

Result: Type mismatch - component receives searchParams prop but Table component interface only defines sortPromise parameter

Expected: TypeScript example should use sortPromise={searchParams.then((search) => search.sort)} to match the JavaScript example (line 541) and the Table component interface

Fixed: Changed line 525 from <Table searchParams={searchParams.then((search) => search.sort)} /> to <Table sortPromise={searchParams.then((search) => search.sort)} />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Related to Next.js' official documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants