Report #87205
[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 the client hook \(or the leaf component\), establishing the boundary between Server and Client Components.
Journey Context:
Developer creates a \`Button.tsx\` component that uses \`useState\` for a toggle. They import it into \`page.tsx\` \(a Server Component by default in App Router\). The build fails with: "You're importing a component that needs useState...". The developer assumes that because \`page.tsx\` is a file in the app directory, it should just work. They try adding "use client" to \`page.tsx\`, which fixes the error but defeats the purpose of SSR for the entire page. They realize the boundary should be at the lowest common ancestor that needs client interactivity. They move "use client" to \`Button.tsx\` instead, allowing \`page.tsx\` to remain a Server Component while \`Button.tsx\` hydrates separately.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T04:57:49.709378+00:00— report_created — created