Installing package
yarn add react-native-text-weight
React Native CLI (not Expo)
Edit android/app/build.gradle
and add the following:
apply from: "../../node_modules/react-native-text-weight/fonts.gradle"
Usage
Insert the following code into the starting point of the application (usually App.js)
Expo
; const loaded setLoaded = ; // its necessary for font loading async and update ui ; return loaded ? <Content /> : <ActivityIndicator />;
React Native CLI
; const loaded setLoaded = ; // its necessary for font loading async and update ui ; return loaded ? <Content /> : <ActivityIndicator />;
Issues
- Custom fonts are not well-tested