Skip to content
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.

Setting anchor or button attributes on react-button causes type errors #679

Closed
@ghost

Description

It should be possible to pass standard HTML attributes for buttons or anchors to the Button component. For example <Button type="submit" /> or <Button href="http://example.com" download />.

However both of these example with cause a type error in typescript, like:

TS2322: Type '{ download: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<{ foundation?: any; isCo
mponentMounted: boolean; displayName: string; state: RippledComponentState; componentDidMount(): void; componentWillUnmount(): void; ... 20 more ...; refs: { ...; }; }> & Pick
<...> & Partial<...> & Partial<...>'.
  Property 'download' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<{ foundation?: any; isComponentMounted: boolean; displayName: string; state: Rippl
edComponentState; componentDidMount(): void; componentWillUnmount(): void; ... 20 more ...; refs: { ...; }; }> & Pick<...> & Partial<...> & Partial<...>'.

This is due to ButtonProps only extending HTMLAttributes<T>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions