-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript: prop Type is not assignable to type never when extending VariantProps
#175
Comments
I have the same issue and I can't seem to land on a solution yet. |
@yaman3bd It looks like you are on an old version of Tailwind Variants. Please update to the latest version and then see if you can still reproduce it. |
@mskelton
my repo which has my library setup: |
@yaman3bd Can you set this up as a code sandbox so I can run the example quickly? |
Describe the bug
I am building a React UI Component library, and using
tailwind-variants
for the styles of the component.for the component props, I am extending
VariantProps
to have the component variants included in the props:however after I built the library and published it to NPM when I want to use any component in my project, typescript always throws an error on the component variants.
my button styles:
To Reproduce
Steps to reproduce the behavior:
I have made this minimal reproducible example:
https://github.com/yaman3bd/tailwind-variants-issue
3.typescript will throw an error on the variant/color props with the following message:
Expected behavior
I expected the types and intellisense to work as expected with correct types and props names,
but it does not work
Screenshots
Additional context
I thought it might be an IDE issue, I have tried it in Webstorm and VSCode and had the same issue, however when I hard coded the variants it worked without any issue:
The text was updated successfully, but these errors were encountered: