Report #90083
[bug\_fix] You're importing a component that needs useState. It only works in a Client Component but none of its parents are marked with 'use client'
Add the string 'use client' at the very top of the file \(above imports\) that contains the useState/useEffect usage, or move the hook-using logic into a dedicated Client Component file and import it into the Server Component.
Journey Context:
Developer migrates a landing page from Next.js Pages Router to App Router. Creates app/page.tsx that imports a UI library's component. Immediately hits build error stating useState can't be used. Developer is confused because the page worked in Pages Router. Reads error message carefully and realizes App Router defaults to Server Components. Attempts to add 'use client' to the page.tsx, which fixes the error but causes the entire page to be client-side rendered, losing SEO benefits. Realizes the granularity principle: only the DatePicker needs to be a Client Component. Creates a new file date-picker-client.tsx with 'use client' at top, imports DatePicker there, and imports that wrapper into the Server Component page. This preserves server-rendering for the rest of the page while isolating client interactivity.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T09:48:04.090550+00:00— report_created — created