react native vector icons 1

react native vector icons

1-npm install --save react-native-vector-icons
2-Edit android/app/build.gradle : (add below code)
    apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
3-Edit android/settings.gradle : (add below codes)
	+ include ':react-native-vector-icons'
	+ project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
4-Edit android/app/build.gradle : (add below code to dependencies)
    dependencies {
    ...
    compile project(':react-native-vector-icons')
}
5-import fontawesome to App.js :
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';

Here is what the above code is Doing:
1. Install the react-native-vector-icons package.
2. Add the following line to android/app/build.gradle:
3. Add the following lines to android/settings.gradle:
4. Add the following lines to android/app/build.gradle:
5. Add the following line to your MainApplication.java:
6. Add the following line to your index.android.js:

Similar Posts