-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
[Feature Request]: A way to get the types for the provided icon collections #18
Comments
🎉 This issue has been resolved in version 1.1.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@egoist was this 1.1.3 release really related to this issue? If I understand correctly, @AbdallahAlhaddad was asking about type for icons names, not collections names. This is exactly what I'm trying to achieve. I have button component that has optional icon prop for icon name (icon class to be precise), and I also have this as string type, which is fine but not perfect. It would be great if I could somehow get type for my whole collection for warnings when name is wrong and autocomplete functionality. For example |
I quickly made this as a "temporary" (wink wink) solution:
So I'm simply generating types file. Again - not ideal, but it will be probably generated just once anyway so it's good enough. Of course this code will work for single collection (this is what I needed). |
Updated version for multiple collections:
Result:
I have this as global, but it can be changed to |
@chojnicki Thanks for your tip. I just updated README to link this issue. |
I think it would be very helpful if we can
import
the types of available icons to use to build awrapper component
which contains more logic to it.The text was updated successfully, but these errors were encountered: