Not able to set custom font for Button in react native element.
I am using "react-native-elements": "^0.19.1" version and trying to set custom font for the button. Already the font is working in the page for Text component.
<Button
rightIcon={{ name: 'history', type: 'font-awesome'}}
transparent={true}
title='History'
fontSize={18}
fontWeight='bold'
fontFamily='montserrat'
/>
But the font is not changing or not throwing any error. I tried to give fontFamily "textStyle", "titleStyle" prop also. No luck.
Font inclusion snippet,
async componentWillMount() {
try{
await Expo.Font.loadAsync({
montserrat: require("./assets/fonts/Montserrat.ttf"),
montserrat_light: require("./assets/fonts/Montserrat_light.ttf")
});
this.setState({ loading: false });
}catch(error){
console.warn('Error loading fonts', error);
}
}
Note : Custom fonts are loaded using componentWillMount method.
Thanks in advance.
rnpmnot work - Robbie MilejczaktextStyle={{fontFamily: 'montserrat'}}- Pritish Vaidya<Text>component using the style prop? - Robbie Milejczak