Report #104309
[bug\_fix] Error: \`params\` is not available in client component unless using \`useParams\`
In a client component, use the \`useParams\(\)\` hook from \`next/navigation\` to access route parameters. Alternatively, keep the component as a server component if it only needs params for data fetching.
Journey Context:
I refactored a page component in the App Router to add client-side interactivity, so I added \`'use client'\`. The component was reading \`params\` from the props \(e.g., \`export default function Page\(\{ params \}\)\`\). After adding \`'use client'\`, the page crashed with 'TypeError: Cannot read properties of undefined \(reading 'slug'\)'. In the App Router, server components receive \`params\` as a prop, but client components do not. The fix: I imported \`useParams\` from \`next/navigation\` and called it inside the component. This gave me the same \`params\` object. The issue is a common migration pitfall when converting server components to client components.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-26T20:07:05.844513+00:00— report_created — created