Closed rturk closed 7 years ago
Don't understand how to use it. When I try this:
import FontAwesome from 'react-native-fontawesome';
...
render() {
return (
<View style={styles.container}>
<TouchableHighlight style={ styles.imageContainer }>
<FontAwesome>
yahoo
</FontAwesome>
</TouchableHighlight>
</View>
);
};
I get the error: Touchable child must either be native or forward setNativeProps to a native component
What to do?
@speller could u try this branch https://github.com/entria/react-native-fontawesome/pull/3
it will solve your problem
@sibelius The patch is incomplete. It work only if I change the first file of the file to import React, { Component } from 'react';
. This solved the error messages, but I still can't see any icons, just a blank page. How to change my example above to see icons? I added the fontawesome-webfont.ttf
to the assets/fonts dir.
ok, I'll fix it
You also need to include the fonts on ios and android
the name should be FontAwesome.ttf
feel free to send a PR to improve README.md instructions
@sibelius The font filename was the issue, thanks!
I'm totally newbie in mobile development and React Native so I just learn everything.
So I suggest following addition to the README: