Skip to content

no-unnecessary-use-client

Flag 'use client' files with no hooks or event handlers — they could be RSC.

Why

An unnecessary client boundary sends the component and its transitive dependencies to the browser without using client-only behavior.

Fix

Review whether the directive can be removed after checking transitive client requirements and intended export boundaries; local syntax alone does not prove server compatibility.

Examples

Before — flagged Remove the directive from static components
src/banner.tsx
"use client";
export default function X() {
return <div>hello</div>;
}
After — preferred Keep the directive for interactive components
src/counter.tsx
"use client";
import { useState } from "react";
export default function X() {
const [n] = useState(0);
return <div>{n}</div>;
}