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

[Button] Issue - loading prop rejected by TypeScript #573

Open
wavinginspace opened this issue Aug 20, 2024 · 2 comments
Open

[Button] Issue - loading prop rejected by TypeScript #573

wavinginspace opened this issue Aug 20, 2024 · 2 comments

Comments

@wavinginspace
Copy link

Basically the title. I am trying to utilize the loading prop on the Button component from @radix-ui/themes and TypeScript won't let me.

Screenshot 2024-08-20 at 4 52 02 PM
Screenshot 2024-08-20 at 4 51 45 PM

Type '{ children: string; className: string; disabled: boolean; id: string; loading: boolean; onClick: ((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | ((event: MouseEvent<...>) => void) | undefined; style: CSSProperties | undefined; type: "button" | "submit"; }' is not assignable to type 'IntrinsicAttributes & ButtonProps & RefAttributes<HTMLButtonElement>'.
  Property 'loading' does not exist on type 'IntrinsicAttributes & ButtonProps & RefAttributes<HTMLButtonElement>'.ts(2322)

The other radix Button props seem to work fine. Maybe I'm doing something wrong?

@kevinmitch14
Copy link

What version are you using? The loading prop was introduced in v3. The best thing to do is to provide a small reproduction.

@wavinginspace
Copy link
Author

@kevinmitch14 Oh man, I should have checked that first. I was still on Radix V2. I upgraded and it works fine now. Thanks for your help!! Sorry for creating an issue that wasn't an issue 😅

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

2 participants