Closed kapobajza closed 2 months ago
Hello.
Describe the bug Intellisense doesn't work when trying to use cva with generic type params.
cva
To Reproduce Steps to reproduce the behavior:
type InputVariant = "primary" | "secondary"; type InputVariantConfig = { variant: Record<InputVariant, string>; }; const inputVariants = cva<InputVariantConfig>( "border-input bg-background", // Intellisense doesn't work here { variants: { variant: { primary: "bg-primary", // Intellisense doesn't work here secondary: "bg-secondary" // Intellisense doesn't work here } } } )
If I remove the <InputVariantConfig> generic type param, it works as expected.
<InputVariantConfig>
Expected behavior Intellisense should be working even when adding generic type params
Desktop (please complete the following information):
Additional context I found a solution for this and I'll create a PR to address it.
Hey! Thanks, but cva isn't designed to accept generic parameters. cva@1.0 will make this clearer
cva@1.0
Hello.
Describe the bug Intellisense doesn't work when trying to use
cva
with generic type params.To Reproduce Steps to reproduce the behavior:
cva
with generic type params:If I remove the
<InputVariantConfig>
generic type param, it works as expected.Expected behavior Intellisense should be working even when adding generic type params
Desktop (please complete the following information):
Additional context I found a solution for this and I'll create a PR to address it.