use client Overuse

"use client" on files that don't use any client-side APIs

infoAI Qualityuse-client-overuse

Why this matters

AI tools add 'use client' as a fix for any error, even when the component doesn't need client-side features. This unnecessarily increases your JavaScript bundle and disables server-side rendering.

Example

Flaggedcomponents/user-card.tsx
"use client";

// Nothing here needs the browser: no state, no effects, no handlers
export function UserCard({ name, email }: Props) {
  return (
    <div>
      <h3>{name}</h3>
      <p>{email}</p>
    </div>
  );
}
Fixedcomponents/user-card.tsx
// No "use client" — this is a server component
export function UserCard({ name, email }: Props) {
  return (
    <div>
      <h3>{name}</h3>
      <p>{email}</p>
    </div>
  );
}

How to fix

Remove 'use client' from components that don't use hooks (useState, useEffect), event handlers (onClick), or browser APIs (window, document). Let them render on the server.

Reference

In the output
Findings carry "ruleId": "use-client-overuse" in --json and the same id in SARIF and in the terminal.
Silence one line
// prodlint-disable-next-line use-client-overuse
Silence a whole file
// prodlint-disable use-client-overuse at the top of the file
How it works
Matches text patterns. Source on GitHub