nextui-org / tailwind-variants

🦄 Tailwindcss first-class variant API
https://tailwind-variants.org
MIT License
2.42k stars 70 forks source link

Typescript errors with `compoundVariants` and boolean values #55

Closed omarkhatibco closed 1 year ago

omarkhatibco commented 1 year ago

Describe the bug

This issue appears when I updated typescript from v5.0.4 to v5.1.3. now when I run the typecehck tsc --noEmit I got this error

src/Button.tsx:19:7 - error TS2322: Type 'true' is not assignable to type 'string | number | symbol | never[] | undefined'.

19       disabled: true,
         ~~~~~~~~

Found 1 error in src/Button.tsx:19

this button component is exactly the live example on the documentation here

To Reproduce Steps to reproduce the behavior:

  1. Go to this sandbox
  2. open a new terminal and run pnpm typecheck

Expected behavior error should not happen

Additional context Add any other context about the problem here.

its-monotype commented 1 year ago

I'm facing the same issue, everything was broken when I switched to TS v5.1.3 :(

jessyhalife commented 1 year ago

I'm getting an error when trying to use an array for variant

size: ["sm", "lg"]

😞