i’m trying to add custom font in my react-nativ-project. i added to this code
module.exports = {
project: {
ios: {},
android: {}
},
assets: ['./assets/fonts/']
}
in to react-native.config.js and
npx react-native-asset
this hapening
'react-native-asset' is not recognized as an internal or external command,
operable program or batch file.
2
Answers
First things first
Make sure your config is named
react-native.config.js
an that the fonts are insideMY-PROJECTS/assets/fonts
Try to re-install react-native-cli
Try to link
Maybe running the following command will fix it if you are with an older react-native version:
make sure installing react-native-asset globally before all configuration.
after running the command
npm i -g react-native-asset
,in order to link your all fonts to your project, run the commandnpx react-native-asset
.