shadcn/ui variant typescript error
does anyone know why this is giving me a typescript error (code compiles fine)?
i'm using custom variants of shadcn/ui's badge component like so:
but for some reason it wont accept the dynamic prop as a variant (both when interpolating like this, or when using {category} which is a string.
code works fine whether i interpolate category or not, the typescript intellisense also shows my custom variants as possible options here:
2 Replies
This is the exported ts interface:
You can leverage the exported
ButtonProps
to use the variant
types: