-
-
Notifications
You must be signed in to change notification settings - Fork 319
Open
Labels
component: buttonChanges related to the button component.Changes related to the button component.typescript
Description
Bug report
Current behavior
I cannot set type prop for a Button component.
<Button type="submit" {...props}>
{children}
</Button>error TS2322: Type '{ children: string | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<...> | null; ... 288 more ...; ref?: Ref<...> | undefined; } | { ...; }' is not assignable to type 'IntrinsicAttributes & (ButtonProps & RefAttributes<HTMLElement>)'.
Type '{ children: string | number | bigint | boolean | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<...> | null; ... 280 more ...; type: "submit"; }' is not assignable to type 'IntrinsicAttributes & (ButtonProps & RefAttributes<HTMLElement>)'.
Property 'type' does not exist on type 'IntrinsicAttributes & ButtonNonNativeProps & RefAttributes<HTMLElement>'.
37 <Button type="submit" {...props}>
~~~~
Expected behavior
I should be able to set it:
Reproducible example
I am not sure how to provide an example.
Base UI version
v1.0.0
Which browser are you using?
N/A (it's happening during type checking)
Which OS are you using?
Mac OS
Which assistive tech are you using (if applicable)?
None
Additional context
I was trying the Shadcn create, but I get the same error when I am using the "native" BaseUI Button.
Metadata
Metadata
Assignees
Labels
component: buttonChanges related to the button component.Changes related to the button component.typescript