vector-icons icon indicating copy to clipboard operation
vector-icons copied to clipboard

Can't find types for icon names

Open stanleyugwu opened this issue 3 years ago • 2 comments

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`

stanleyugwu avatar Jan 08 '22 21:01 stanleyugwu

Possible solution: #153

de1ay avatar Jan 15 '22 13:01 de1ay

Thanks alot @de1ay

stanleyugwu avatar Jan 25 '22 17:01 stanleyugwu