expo / vector-icons

https://icons.expo.fyi
MIT License
647 stars 114 forks source link

Can't find types for icon names #199

Open stanleyugwu opened 2 years ago

stanleyugwu commented 2 years ago

So am creating a custom component <InputField/> which renders Ionicon icon as one of its children. I want the user of that component to be able to pass the name of the Ionicon icon he/she wants InputField to show via iconName prop.

Am using typescript so I need to type iconName to be one of the icon names that Ionicon supports (probably a union type). There seems not to be a way to do this as I can't find exported types for icon names in this library.

I want to be able to do something like this:

import {IoniconName} from 'somewhere_in_the_library';
export type InputFieldProps = {
    iconName: IoniconName;
    //...Rest of the props for InputField
}

//...Rest of the code for `InputField`
de1ay commented 2 years ago

Possible solution: #153

stanleyugwu commented 2 years ago

Thanks alot @de1ay