Can't find types for icon names
- Dominant language
- JavaScript
- Stars
- 743
- Forks
- 123
- PR merge metrics
- No merged PRs in 30d
Description
So am creating a custom component `` 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:
```typescript
import {IoniconName} from 'somewhere_in_the_library';
export type InputFieldProps = {
iconName: IoniconName;
//...Rest of the props for InputField
}
//...Rest of the code for `InputField`
```
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue names the Ionicon component and the desired IoniconName export, but no repository file or test. Start by locating Ionicon's icon-name definitions and public exports; done means TypeScript consumers can import a type restricting iconName to supported names.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react-native, typescript
- Domain
- developer-experience, mobile
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100