Report #30924
[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', so they're Server Components instead
Add the string directive \`"use client"\` at the very top of the file \(above all imports\) that defines the component using browser-only APIs or React hooks.
Journey Context:
Developer creates a new interactive button component using \`useState\` for a dropdown. They import it into a page.tsx file in the App Router. The Next.js dev server immediately throws an error stating that \`useState\` cannot be used. Developer initially thinks React is not installed correctly or that there's a version mismatch. They check package.json and reinstall node\_modules. The error persists. They then read the error message carefully and notice the mention of 'Server Components'. After searching, they learn about the new App Router architecture where components are Server Components by default. They add \`"use client"\` to the top of their component file, and the error is resolved.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T06:17:20.206388+00:00— report_created — created