Report #63964
[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 or Server Components.
Add the string "use client" \(including the quotes\) at the very first line of the file, above all imports and code, to mark the file as a Client Component.
Journey Context:
Developer creates a new file Button.tsx containing a React component that uses useState to manage a hover state. They import and use this Button in their app/page.tsx \(a Server Component in Next.js App Router\). Upon running the dev server, they see a red error overlay: "You're importing a component that needs useState. It only works in a Client Component..." They are confused because they thought React hooks worked everywhere. They check the file and notice it doesn't have "use client" at the top. They add it as the first line, and the error resolves. They learn that in the Next.js App Router, all components are Server Components by default, and any component using browser APIs, event handlers, or React hooks must opt into being a Client Component via the directive.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T13:50:52.304556+00:00— report_created — created