This repository was archived by the owner on Jan 14, 2025. It is now read-only.
This repository was archived by the owner on Jan 14, 2025. It is now read-only.
FAB should also extend React.ButtonHTMLAttributes #660
Closed
Description
While working on a PR for an exited prop (#658) I wanted to pass an onClick
handler to toggle exit value. However, since FAB was not extending React.ButtonHTMLAttributes
I was unable to pas sonClick
. This also extended to other attributes you may find on a button. E.g. title, name, or type.
error msg when including name
TS2322: Type '{ exited: boolean; mini: true; icon: Element; name: string; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<withRipple<FabProps, HTMLButtonElement, Element>.RippledComponent> & Pick<Readonly<{ children?: ReactNode; }> & Readonly<Pick<...> & RippledComponentProps<...>>, "children" | ... 3 more ... | "textLabel"> & Partial<...> & Partial<...>'.
Property 'name' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<withRipple<FabProps, HTMLButtonElement, Element>.RippledComponent> & Pick<Readonly<{ children?: ReactNode; }> & Readonly<Pick<...> & RippledComponentProps<...>>, "children" | ... 3 more ... | "textLabel"> & Partial<...> & Partial<...>'.
Changing
export interface FabProps extends Ripple.InjectedProps<HTMLButtonElement> {}
TO
export interface FabProps extends Ripple.InjectedProps<HTMLButtonElement>, React.ButtonHTMLAttributes<HTMLButtonElement> {}
resolves the error message. Might there be a better solution?
Metadata
Metadata
Assignees
Labels
No labels