Currently, I am in the process of determining the type definitions for the icon name within expo/vector-icons, as I have plans to utilize it for a component's props.
My approach involves importing expo/vector-icons and defining interface props by specifying the type of icon name as a string.
import Icon from "@expo/vector-icons/FontAwesome"
interface Props {
icon: string
value: string
placeholder: string
onChangeText: (text: string) => void
secureTextEntry?: boolean
style: StyleProp<ViewStyle>
}
This is how I am implementing the prop:
<Icon name={icon} size={20} style={styles.icon} />
Despite my efforts, Typescript presents me with an error. https://i.sstatic.net/L6H4v.jpg