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]: Property 'id' does not exist on type 'IntrinsicAttributes & SelectProps'. #5262

Open
2 tasks done
sovetski opened this issue Oct 9, 2024 · 1 comment
Open
2 tasks done
Labels
bug Something isn't working

Comments

@sovetski
Copy link

sovetski commented Oct 9, 2024

Describe the bug

I want to add "id" property to the "Select" component like this

<Select id="test">
    // blabla
</Select>

It says:

Property 'id' does not exist on type 'IntrinsicAttributes & SelectProps'.

Affected component/components

Select

How to reproduce

Just try this:

<Select id="test">
    // blabla
</Select>

Codesandbox/StackBlitz link

No response

Logs

No response

System Info

Windows 11, Chrome

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@sovetski sovetski added the bug Something isn't working label Oct 9, 2024
@Krishcode264
Copy link

Krishcode264 commented Oct 10, 2024

export interface SelectProps { children?: React.ReactNode; value?: string; defaultValue?: string; onValueChange?(value: string): void; open?: boolean; defaultOpen?: boolean; onOpenChange?(open: boolean): void; dir?: Direction; name?: string; autoComplete?: string; disabled?: boolean; required?: boolean; } export const Select: React.FC<SelectProps>;

as we can see SelectProps does not have "id " as an type , there can be two ways to add it

  1. we could add direct id type in SelectProp

  2. we could extend its types as HTMLElement<> it could infer those default types , i need some guide related to this if we really have to do this .....

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

No branches or pull requests

2 participants