react native app with typescript and I'm trying to create icon button that uses @expo/vector-icons with Fontawesome or MaterialIcon dynamically by trying to pass a name as a string via props.
I think the issue is this, BUT don't know how to solve it. Any ideas? Suggestions? Also feel free to criticize other code.
Below is my IconButton component that receives the name prop
import { Ionicons, MaterialIcons, FontAwesome } from
"@expo/vector-icons";
const star = "star";
type Props = { …Run Code Online (Sandbox Code Playgroud)