Skip to content

Auto Generate universal icon types #6

@danspratling

Description

@danspratling

Currently, each icon has types generated but if you want to cast types to a prop outside the library this is really awkward.

Consider the following

export const Button = ({ icon }: { icon: any }) => (
  <button>
    {icon}
    Click me!
  </button>
)

What should the type of icon be?

The closest the library creates right now would mean having to do something like importing a random icon and then using typeof to figure out its type, but this isn't clear and doesn't appear as a generic icon type.

Ideally, we'd be able to do something like `import type { NoIconType } from '@noicons/react'

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