-
-
Notifications
You must be signed in to change notification settings - Fork 540
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
lucide-react - Generate types for all exported icons #243
Conversation
@FPDK First of all, welcome to the Lucide Community! Yes partially, only |
…e identical. Fixed by adding an index attribute to the hash.
@FPDK is attempting to deploy a commit to the Lucide Team on Vercel. A member of the Team first needs to authorize it. |
…butse are identical. Fixed by adding an index attribute to the hash." This reverts commit 1c42b39
@ericfennis Thank you for the warm welcome 😄 Please ignore commit 1c42b39 in this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FPDK Nice work, thanks for your effort!
I came across some minor improvements we can make. I did also some learnings from other packages.
The types were working, I had no errors, but when hovering on the icon, the intellisense in my IDE was still saying: const Icon: any
.
Also the IDE don't give suggestions:
So I try to figure out the problem, and I found out that the FC is breaking the typescript checking. This article makes it clear to me: typescript-react-why-i-dont-use-react-fc
So I made some code suggestions fixing this.
IDE also hinting props defined in the LucideProps interface
@ericfennis Thank you for the information and improvements. I'm gonna add React.FC to my naughty list :) |
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/lucide/lucide/9m7ysxVhHs2a24nmVrBCayX2vLqP [Deployment for 6998ddb canceled] |
@FPDK Can you also move the
|
@FPDK I will merge this, and finish this. I want add to this in the next release. Thanks for your contribution! |
@ericfennis sorry for not answering, glad you could finish it :) |
Solves the React.js part of issue #226
The types in LucideProps are declared so they match the props mentioned in https://github.com/lucide-icons/lucide/blob/master/packages/lucide-react/README.md#props. They could be removed, since they're already present in SVGAttributes.