Closed hristo-enev closed 2 years ago
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/aykutkardas/react-icomoon/E3sYY3Fqcstm7PvGXgCCUGd1TuF2
✅ Preview: https://react-icomoon-git-fork-hristo-enev-patch-1-aykutkardas.vercel.app
IconComponent
should contain props as well. Did you have a problem while using it?
IconComponent
should contain props as well. Did you have a problem while using it?
Yes, as I said Typescript will complain about the above examples I have provided. Also another use case would be to add new props to my Icon component. Then I would need to define an interface that extends IconProps, but I cannot import IconProps. Basically what I'm trying to say is - exporting just IconComponent and relying that everyone would create an Icon component that is a typeof IconComponent is limiting. Sometimes you might want to create a bit different component that have different props for example but still relies on IconProps main props.
You are right, I agree with you. Thanks for your contribution. 🎉
Typescript will complain if I want to introduce a default icon size, for example, because I can't point to the correct IconProps.
or