Describe the bug
The Base UI scroll-area registry component includes:
import * as React from "react"
but never uses the React namespace (types come from ScrollAreaPrimitive.*.Props, JSX uses the automatic runtime).
With a typical Vite + React TypeScript config ("jsx": "react-jsx", "noUnusedLocals": true), tsc fails:
src/components/ui/scroll-area.tsx: error TS6133: 'React' is declared but its value is never read.
The unused import is present in the published registry and in the source of truth:
Expected: either remove the unused import, or use React only where needed (e.g. React.ComponentProps<...>), so generated files typecheck under noUnusedLocals.
Affected component/components
scroll-area (base / base-luma)
How to reproduce
- Create a Vite + React + TypeScript app with
"noUnusedLocals": true in tsconfig.
- Init shadcn with a Base style (e.g.
base-luma) and rsc: false.
- Run
npx shadcn@latest add scroll-area.
- Run
tsc -b (or the project's typecheck / build that invokes tsc).
- See
TS6133: 'React' is declared but its value is never read.
Codesandbox/StackBlitz link
N/A — reproduction is the stock registry file; no app-specific code required. Diff vs a fixed version is removing the unused React import (CLI already strips "use client" when rsc: false).
Logs
src/components/ui/scroll-area.tsx:1:13 - error TS6133: 'React' is declared but its value is never read.
1 import * as React from "react"
~~~~~
Found 1 error.
System Info
shadcn style: base-luma (Base UI)
TypeScript: noUnusedLocals=true, jsx=react-jsx
Package manager: yarn / npm / pnpm (any)
Framework: Vite + React
Before submitting
Describe the bug
The Base UI
scroll-arearegistry component includes:but never uses the
Reactnamespace (types come fromScrollAreaPrimitive.*.Props, JSX uses the automatic runtime).With a typical Vite + React TypeScript config (
"jsx": "react-jsx","noUnusedLocals": true),tscfails:The unused import is present in the published registry and in the source of truth:
Expected: either remove the unused import, or use
Reactonly where needed (e.g.React.ComponentProps<...>), so generated files typecheck undernoUnusedLocals.Affected component/components
scroll-area (base / base-luma)
How to reproduce
"noUnusedLocals": trueintsconfig.base-luma) andrsc: false.npx shadcn@latest add scroll-area.tsc -b(or the project's typecheck / build that invokestsc).TS6133: 'React' is declared but its value is never read.Codesandbox/StackBlitz link
N/A — reproduction is the stock registry file; no app-specific code required. Diff vs a fixed version is removing the unused React import (CLI already strips
"use client"whenrsc: false).Logs
System Info
Before submitting