[bug]: CLI ignores `rsc: false` setting and adds `"use client"` directive
Describe the bug
Summary
The shadcn add command adds the "use client" directive to components even when rsc: false is set in components.json. According to the documentation, when rsc is set to false, the CLI should NOT add the "use client" directive.
Configuration
{
"$schema": "https://ui.shadcn.com/schema.json",
"rsc": false,
"style": "new-york-v4",
"tsx": true
}
Expected Behavior
According to the documentation:
The CLI automatically adds a
use clientdirective to client components when set totrue.
Therefore, when rsc: false, the CLI should NOT add the "use client" directive.
Actual Behavior
The CLI adds "use client" at the top of installed components even when rsc: false is set.
Example installed file:
"use client"
import * as React from "react"
// ... rest of component
Workaround
Manually remove the "use client" directive from installed components after installation.
Affected component/components
Toggle Group
How to reproduce
- Set
"rsc": falseincomponents.json - Run
npx shadcn@latest add toggle-group(or any component) - Check the installed component file
Codesandbox/StackBlitz link
No response
Logs
System Info
- **CLI Version**: `shadcn@latest` (3.5.1)
- **React Version**: 19.1.0
- **React DOM Version**: 19.1.0
- **Tailwind CSS Version**: 4.0.6 (with `@tailwindcss/[email protected]` and `@tailwindcss/[email protected]`)
- **Package Manager**: npm
- **Project Type**: Monorepo
Before submitting
- [x] I've made research efforts and searched the documentation
- [x] I've searched for existing issues
can i work on this issue ??