Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto Generate universal icon types #6

Open
danspratling opened this issue Sep 29, 2023 · 0 comments
Open

Auto Generate universal icon types #6

danspratling opened this issue Sep 29, 2023 · 0 comments

Comments

@danspratling
Copy link
Contributor

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant