Skip to content

Conversation

@qublaidev
Copy link

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: ddf2399

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

1 similar comment
@ijjk
Copy link
Member

ijjk commented Oct 24, 2025

Allow CI Workflow Run

  • approve CI run for commit: ddf2399

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 example uses the prop name searchParams but should use sortPromise to match the Table component's parameter name and be consistent with 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

Incorrect prop name in TypeScript example for Cache Components documentation

What fails: The TypeScript code example on line 525 of docs/01-app/01-getting-started/06-cache-components.mdx passes a Promise to the Table component using the incorrect prop name searchParams instead of sortPromise, causing a type mismatch with the component definition.

How to reproduce: Compare the TypeScript example (line 525) with the JavaScript example (line 541) and the Table component definition (lines 551-552):

  • Line 525 (TypeScript, incorrect): <Table searchParams={searchParams.then((search) => search.sort)} />
  • Line 541 (JavaScript, correct): <Table sortPromise={searchParams.then((search) => search.sort)} />
  • Lines 551-552 (component definition): export async function Table({ sortPromise }: { sortPromise: Promise<string> }) {

Result: The TypeScript example uses a prop name that doesn't exist in the component signature, making the example incompatible with the Table component.

Expected: Both TypeScript and JavaScript examples should use the same prop name sortPromise to match the component definition.

Fix applied: Changed line 525 from <Table searchParams=... to <Table sortPromise=... to match the JavaScript example and component definition.

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