Typescript error on shadcn components #3944
Replies: 3 comments
-
You might not be importing the button correctly. Check if the import paths are correct. |
Beta Was this translation helpful? Give feedback.
-
I had this same error, not sure if this is the best way of fixing this but in my tsconfig.json I changed "moduleResolution": "bundler", |
Beta Was this translation helpful? Give feedback.
-
I have same problem with this, and im pretty sure because @types/react v.19 have a bug of this.. so i try to downgrade my @types/react to v.18.3.12 and my error was gone.. soon this bug will be fix, |
Beta Was this translation helpful? Give feedback.
-
I am trying to use a button as so
<Button variant="outline" size="icon">
however I am getting a typescript error on the variant attribute with the following message:
"Type '{ children: Element; variant: string; size: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps & RefAttributes'.
Property 'variant' does not exist on type 'IntrinsicAttributes & ButtonProps & RefAttributes'.ts(2322)"
what is the solution to this? Thanks
Beta Was this translation helpful? Give feedback.
All reactions