Skip to content
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

[BUG] - extendVariants TypeScript Error - Object literal may only specify known properties, and 'trigger' does not exist in type 'ClassNameArray'.ts #4128

Open
kimskovhusandersen opened this issue Nov 21, 2024 · 1 comment

Comments

@kimskovhusandersen
Copy link

kimskovhusandersen commented Nov 21, 2024

NextUI Version

2.4.8

Describe the bug

I’m working on extending the Select component, and I noticed that the TypeScript error happens not only for Select but for all slot components when using extend-variants.
The error occurs when using the class property inside the object of the compoundVariants array. The error message states that 'xxx' (e.g. trigger) does not exist in type ClassNameArray.

Object literal may only specify known properties, and 'trigger' does not exist in type 'ClassNameArray'.ts(2353)
index.d.ts(20, 6): The expected type comes from property 'class' which is declared here on type 'VariantValue<{ variant: { variant1: { trigger: string[]; label: string; value: string; }; variant2: { trigger: string[]; label: string[]; value: string; }; variant3: { trigger: string[]; innerWrapper: string[]; label: string; value: string[]; }; variant4: { ...; }; ... 10 more ...; disableSelectorIconRotation: { ...'

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

  • Use extendVariants to extend the Select component.
  • Declare a new variant and use compoundVariants.
  • Inside the compoundVariants array, use the class property with any valid property defined as a key.

Expected behavior

Any valid property should be allowed in the class object.

Screenshots or Videos

Screenshot 2024-11-21 at 14 27 17

Operating System Version

macOS

Browser

Chrome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant