UPDATE
Many answers are here for adding custom font in react-native for version < 0.60.
For those who are using react-native version > 0.60 , 'rnpm' is deprecated
and custom fonts will not work.
Now, in order to add custom font in react-native version > 0.60 you will have to :
1- Create a file named react-native.config.js
in the root folder of your project.
2- add this in that new file
module.exports = {
project: {
ios: {},
android: {},
},
assets: ['./assets/fonts']
};
For those running on react-native version < 0.69.x
3- run react-native link
command in the root project path.
PS Make sure you have the right path for the fonts folder before running react-native link
command
For those running on react-native version >= 0.69.x, Since link
is deprecated so react-native link
will not work anymore,
the command react-native link
is replaced by npx react-native-asset
.
More info about the release can be seen here: https://github.com/react-native-community/cli/releases/tag/v8.0.0