In my react-native application I have added this library react-native-vector-icons to use icons. From the github page, FontAwesome is listed among the bundled icon sets. But I don't see how I can reference a fontawesome item in my element. It seems that I can only use "ios-xxx", "md-xxx" or "log-xxx".
When I try something like:
<Icon name='fa-rss' style={{marginRight:10}} />
I get this warning:
Use of Font-Awesome Icon in React NativeYou can apply styles directly into the FontAwesome RN component by just passing a style as you do in a <Text> component. You need to pass the icon name which you can get from the Official Site. There are many filters to find the Icon of your need.
@expo/vector-icons This library is installed by default on the template project using npx create-expo-app and is part of the expo package. It is built on top of react-native-vector-icons and uses a similar API. It includes popular icon sets that you can browse at icons.
Installation of React Native Vector Icons. 1. Open your react native project folder in command prompt and execute the below code: npm install react-native-vector-icons --save.
Use
import Icon from 'react-native-vector-icons/FontAwesome';
<Icon name="rss" size={30} color="#900" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With