I am completely new to react native. Currently exploring the react native vector icons for FontAwesome 5 pro icons.
https://github.com/oblador/react-native-vector-icons
There are 3 types of icon sets for FontAwesome 5 such as regular, solid and light.
import Icon from 'react-native-vector-icons/FontAwesome5';
const myIcon1 = <Icon name="comments" size={30} color="#900" />; // Defaults to regular
const myIcon2 = <Icon name="comments" size={30} color="#900" solid />;
const myIcon3 = <Icon name="comments" size={30} color="#900" light />; // Only in FA5 Pro
Is there any way I can pass the icon type (light, solid) dynamically?
I have tried the following so far:
let iconType = focused ? 'solid' : 'light';
return <Icon name="comments" size={30} color="#900" {...iconType} />;