1

I have a TouchableHighlight, inside of it, I want to put an image exactly the same as xf138 in FontAwesome which looks like an arrow: http://fontawesome.io/icon/chevron-circle-right/

I don't know how to display it, I tried to use Text inside of the TouchableHighlight, but I get "Unexpected token" error in below code:

&#xf138

And I wonder which fontFamily I should use inside myStyle, it seems there is no FontAwesome in the fontFamily of react native.

spspli
  • 3,128
  • 11
  • 48
  • 75

1 Answers1

0

You can include the react-native-fontawesome module in your project and then use it as such (from https://github.com/entria/react-native-fontawesome):

import FontAwesome, { Icons } from 'react-native-fontawesome';

...
render() {
  return (
    <View>
      <TouchableHighlight>
        <Text style={{margin: 10, fontSize: 15, textAlign: 'left'}}>
          <FontAwesome>{Icons.chevronLeft}</FontAwesome>
          Text
        </Text>
      </TouchableHighlight>
    </View>
  );
},
jaws
  • 1,952
  • 4
  • 20
  • 27