Answers for "how to use icons in react native"

13

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';
Posted by: Guest on January-07-2021
4

icon shwoing a box react native vector icons

In 'android/app/build.gradle' (not in android/build.gradle),

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

Then,
react-native link react-native-vector-icons 
react-native run-android
react-native start
Posted by: Guest on June-06-2020
2

how to use icons in react native

//USING EXPO

//Firtsly, install expo icons and import  
import { MaterialCommunityIcons } from "@expo/vector-icons/"
//Later in your code, use them like this
<MaterialCommunityIcons color="white" name="close" size={35} />
Posted by: Guest on July-23-2021
1

react native icons

rootProject.name = 'MyApp'

include ':app'

+ include ':react-native-vector-icons'
+ project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
Posted by: Guest on June-17-2021
0

react native icons

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
Posted by: Guest on March-31-2021
0

react native icons

apply plugin: 'com.android.application'

android {
  ...
}

dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
  compile "com.android.support:appcompat-v7:23.0.1"
  compile "com.facebook.react:react-native:+"  // From node_modules
+ compile project(':react-native-vector-icons')
}
Posted by: Guest on June-17-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language