Visitar URL original
Why strokeWidth is not be passed as a property? · Issue #83 · feathericons/react-feather · GitHub
Skip to content

Why strokeWidth is not be passed as a property? #83

Open

Description

@vineetdigit

This is more of a question rather than an issue. But I see that for all icons, the strokeWidth is always set to 2. Except for the size and stroke, almost all SVG properties are directly assigned. Is the expectation to change them with CSS?

Activity

  1. dexterthemsb commented on Jan 30, 2021

    @dexterthemsb

    You can pass strokeWidth as props. It'll just override the default value of 2. The library is using a spreader operator to apply properties other than size, color, etc.

  2. RinMinase commented on Nov 9, 2024

    @RinMinase

    @dexterthemsb You can, but typescript compiler throws out an error for this, as this is not in their type declarations.

    Type '{ size: number; strokeWidth: number; }' is not assignable to type 'IntrinsicAttributes & IconProps & Readonly<Attributes & { children?: ComponentChildren; ref?: Ref<any> | undefined; }>'.
      Property 'strokeWidth' does not exist on type 'IntrinsicAttributes & IconProps & Readonly<Attributes & { children?: ComponentChildren; ref?: Ref<any> | undefined; }>'
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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