Skip to content
Open
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
2 changes: 1 addition & 1 deletion docs/01-app/01-getting-started/06-cache-components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ export default function Page({ searchParams }) {
<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)} />
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.

</Suspense>
</section>
)
Expand Down
Loading