Report #104620
[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 \`'use client'\` directive at the top of the file that uses hooks \(or the file that exports the component using hooks\). Alternatively, pass the hook-using component as a child or prop to a Server Component \(the 'children as props' pattern\) to keep the parent as a server component.
Journey Context:
I had a Server Component \(default in App Router\) that rendered a search bar with local state. I got this error because I tried to use \`useState\` directly in a server component. I initially added \`'use client'\` to the page file, but that turned the whole page into a client bundle, losing server-side benefits. The proper fix was to create a separate file for the search bar, add \`'use client'\` to that file, and then import it into the server page. This keeps the page server-rendered while isolating the interactive part.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-09-13T20:06:14.724581+00:00— report_created — created