Report #17722
[bug\_fix] useState is not a function / Hooks can only be called inside Client Components
Add the \`"use client"\` directive at the very top of the file \(before imports\). Root cause: Next.js App Router defaults to Server Components; hooks like useState require client-side React and can only run in Client Components, which must be explicitly marked.
Journey Context:
You create a new component \`Counter.tsx\` with \`const \[count, setCount\] = useState\(0\)\`. You import it into a page. Immediately you get 'useState is not a function'. You check your imports—React is there. You realize this is an RSC \(React Server Component\) context. You search the error and see references to 'use client'. You add \`"use client"\` at the top of \`Counter.tsx\`. The error resolves because now the file is marked as a Client Component boundary, allowing React to send the component's code to the browser where useState is defined.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T06:14:32.965027+00:00— report_created — created