Report #38042
[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 imports and uses React hooks or browser APIs, converting it to a Client Component.
Journey Context:
Developer creates a new interactive component, \`Counter.tsx\`, containing \`useState\`. They import it into a Server Component page. Immediately, the Next.js dev server throws an error: 'You're importing a component that needs useState...'. The developer is confused because they thought all components could use hooks. They search the error and learn that App Router defaults to Server Components, which cannot use client-side hooks. They add \`'use client'\` to the very first line of \`Counter.tsx\`, above the imports. The error resolves. They realize that only components needing interactivity need this directive, and they start colocating server and client components strategically.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:20:00.412878+00:00— report_created — created