You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting an typescript error for the type of item.
Type '(item: Item) => JSX.Element' is not assignable to type 'CollectionChildren<unknown> | undefined'.
Type '(item: Item) => JSX.Element' is not assignable to type '(item: unknown) => CollectionElement<unknown>'.
Types of parameters 'item' and 'item' are incompatible.
Type 'unknown' is not assignable to type 'Item'. ts(2322)
ameytessact
changed the title
[BUG] - Listbox dynamic item give unknown type to item if Listbox is exteded using extendVariants in Typescript
[BUG] - Listbox dynamic item give unknown type to item if Listbox is extended using extendVariants in Typescript
May 20, 2024
NextUI Version
2.3.0
Describe the bug
A listbox component that is extended does not infer the types correctly.
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
I have a simple Listbox that uses dynamic items as follows:
I am getting an typescript error for the type of
item
.Here is how I've extended my Listbox component:
Expected behavior
This error gets fixed automatically if I use the next ui component directly as such:
item
also get the correct type inferred instad ofunknown
I expect the extended component to infer the type correctly as well.
Screenshots or Videos
No response
Operating System Version
Ubuntu 24.04
Browser
Chrome
The text was updated successfully, but these errors were encountered: