cva
cva copied to clipboard
cx error Argument of type 'false' is not assignable to parameter of type 'ClassValue'
Describe the bug When using cx with false values, Typescript complains that false is not assignable to 'ClassValue'.
To Reproduce Steps to reproduce the behavior:
className={cx(
'absolute top-1/2 -translate-y-1/2 right-4 text-gray-500',
hasError && 'text-red-400'
)}
Expected behavior
I expect no typescript error, as the underlying library clsx can handle false
as a value.
Software used:
- Visual Studio Code 1.85.1 (MacOS)
- Typescript 5.3.2
Unable to recreate this – I'm using false
in many projects with no issues. Please provide a working reproduction
We were still using an older version of the package. After updating from 0.4.0 to 0.7.0 this issue was resolved. Sorry for the inconvenience 🙈.