You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypeScript Type Error When Using rc-select with CSS Modules and Vite. #1143
TS2375: Type { className: string | undefined; } is not assignable to type SelectProps<any, DefaultOptionType> with 'exactOptionalPropertyTypes: true'. Consider adding undefined to the types of the target's properties.
Types of property className are incompatible.
Type string | undefined is not assignable to type string
Type undefined is not assignable to type string
This looks like a good regression-test candidate because the failure is narrowed to “TypeScript Type Error When Using rc-select with CSS Modules and Vite.”. If a minimal fixture can exercise rc-select and assert the expected behavior around exactOptionalPropertyTypes: true, it would make the eventual fix much easier to keep from regressing.
Thanks for the report. We are going to keep the current prop typings as-is and do not plan to adjust rc-select specifically for exactOptionalPropertyTypes compatibility here.
For CSS Modules that may return string | undefined, please normalize the value before passing it to className, or avoid passing the prop when the class is missing.
Activity
fix: fix typing of BaseSelectProps.className (fixes react-component#1143
hiSandog commentedon Jul 5, 2026
This looks like a good regression-test candidate because the failure is narrowed to “TypeScript Type Error When Using rc-select with CSS Modules and Vite.”. If a minimal fixture can exercise
rc-selectand assert the expected behavior aroundexactOptionalPropertyTypes: true, it would make the eventual fix much easier to keep from regressing.afc163 commentedon Jul 5, 2026
Thanks for the report. We are going to keep the current prop typings as-is and do not plan to adjust rc-select specifically for
exactOptionalPropertyTypescompatibility here.For CSS Modules that may return
string | undefined, please normalize the value before passing it toclassName, or avoid passing the prop when the class is missing.