I'm running into a peculiar error using React Native. Inside my button.js
I am doing
import Icon from "react-native-vector-icons/MaterialIcons";
const icon = (Icon name="menu size={20} color="green"/>);
render()
return(
{icon}
)
But I'm given the error
Unrecognized Font Family 'Material Icons'
However when I import FontAwesome as:
import Icon from "react-native-vector-icons/FontAwesome";
I get no error.
The same issue was fixed after triggering loadFont()
method
import Icon from 'react-native-vector-icons/FontAwesome';
Icon.loadFont();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With