I managed to load custom font on my react-native expo app following the official documentation:
const App = () => {
let [fontsLoaded] = useFonts({
'Lato-Regular': require('../assets/fonts/Lato-Regular.ttf'),
'Lato-Bold': require('../assets/fonts/Lato-Bold.ttf'),
'Poppins-Light': require('../assets/fonts/Poppins-Light.ttf'),
'Poppins-Bold': require('../assets/fonts/Poppins-Bold.ttf'),
});
So I can use it with the component style:
<Text style={{
fontFamily: 'Lato-Bold'
}}>Home page.</Text>
But I would like to use it like this:
<Text style={{
fontFamily: 'Lato',
fontWeight: 'bold',
}}>Home page.</Text>
This works for system fonts, but not with custom fonts.
How can I deal with it?