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

Select does not allow to specify a generic argument #1767

Closed
GerardasB opened this issue Jan 4, 2024 · 4 comments · Fixed by #1774
Closed

Select does not allow to specify a generic argument #1767

GerardasB opened this issue Jan 4, 2024 · 4 comments · Fixed by #1774
Assignees
Labels
bug Something isn't working

Comments

@GerardasB
Copy link

Describe the bug (actual behavior)

Rendering a select with a generic argument <Select<string> /> results in Expected 0 type arguments, but got 1.ts(2558) error.
Additionally, the implicit value type is unknown, resulting in (_: unknown) => void | undefined type for onChange prop.

Expected behavior

Allow specifying a generic argument for the Select component.

Additional information

Version 3.2.1

// Select.d.ts
export declare const Select: React.ForwardRefExoticComponent<SelectProps<unknown> & React.RefAttributes<HTMLElement>>;
@GerardasB GerardasB added the bug Something isn't working label Jan 4, 2024
@mayank99
Copy link
Contributor

mayank99 commented Jan 4, 2024

Repro: https://stackblitz.com/edit/github-nubvvd?file=src%2FApp.tsx

This might have been caused by #1615. Need to investigate further.

@siddhantrawal siddhantrawal self-assigned this Jan 4, 2024
@siddhantrawal
Copy link
Contributor

Repro: stackblitz.com/edit/github-nubvvd?file=src%2FApp.tsx

This might have been caused by #1615. Need to investigate further.

Confirmed, It is caused due to this #1615. For testing, I replaced the code we had earlier and it worked. But I guess we still need to pass the ref right?

@mayank99
Copy link
Contributor

mayank99 commented Jan 8, 2024

Yes, we need to fix the typescript issue while still forwarding the ref.

@mayank99
Copy link
Contributor

fixed in 3.2.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants