Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react-native-elements icons not showing

Tags:

react-native

React-Native-Elements icons showing as (?)

What am I doing wrong? The code looks nearly identical to the sample that they provided on their site.

This is what I see (don't mind the middle icon, it's brought in differently):

enter image description here

Code that I'm using for the left icon:

<Icon name='users' type='Feather' size={25} color={tintColor} />

Code for the right icon:

GamesInProgressTab: {
    screen: GamesInProgressNavigator,
    navigationOptions: {
    title: 'Games',
    tabBarIcon: ({ tintColor }) => ( <Icon name='rocket' type='Entypo' size={25} color={tintColor} /> ),
    }
} 
like image 911
haosmark Avatar asked Dec 23 '22 04:12

haosmark


2 Answers

In my case, I was using react native elements and the Icons were not showing, only displaying Chinese/Japanese type of a font.

Note: My app was React Native CLI managed and NOT Expo managed.

My Environment:

react-native": "0.62.1", react-native-elements": "^1.2.7"

Despite being advised that in RN > 0.60 linking is automatic, I had to manually link the vector icons using:

react-native link react-native-vector-icons 
like image 189
Tadiwanashe Avatar answered Dec 25 '22 22:12

Tadiwanashe


You have a typo in your type prop.

You need to use one of the following names of the supported types

  • material-community
  • font-awesome
  • octicon
  • ionicon
  • foundation
  • evilicon
  • simple-line-icon
  • zocial
  • entypo
  • feather
like image 31
Pritish Vaidya Avatar answered Dec 26 '22 00:12

Pritish Vaidya