Skip to content

IconFamilyType do not reflect accepted values defined in getIconType helper #242

@aayush123

Description

@aayush123

Describe the bug
IconFamilyType forces Icon's family ty'pe to accept values such as 'EvilIcons', 'FontAwesome' etc, however, getIconType helper accepts values such as 'evilicons', 'font-awesome' etc, due to which, default case, ie. MaterialIcon is returned always.

To Reproduce
Steps to reproduce the behaviour:

  1. Import Icon
  2. Pass family as FontAwesome (as expected by TS declaration) and name as address-book.
  3. See error

Expected behavior
FontAwesome's address-book icon should be visible.
Instead, no icon is identified and ? is displayed.

Additional context / Proposed Solution
Either the IconFamilyType should be updated to reflect actual accepted values, or getIconType should be updated to handle new values specified by IconFamilyType.
In my opinion, IconFamilyType should be updated as it will maintain backward compatibility and fix type issue also, as the new types are anyway buggy by nature.

Willing to submit PR for same.

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