Can't link assets (fonts) in react native >= 0.60

Well, finally, I linked my fonts,

I just renamed my file react-native-config.js to react-native.config.js and it worked.

I don't know if this is the right way, I just tried and it worked, for me at least.

Here is the complete walkthrough for linking custom fonts.


my react-native.config.js

module.exports = {
project: {
    ios: {},
    android: {},
},
assets: ['./assets/fonts/'],
};

and logs:

info Linking assets to ios project                                                                                      
info Linking assets to android project                                                                                  
success Assets have been successfully linked to your project

but My mistake was:

Wrong way:

fontFamily: BYekan

Right way:

fontFamily: 'BYekan'

just put font name in ''


Just to complement keyserfaty's answer, here is my react-native.config.js working using react-native link:

module.exports = {
  dependencies: {
    "react-native-gesture-handler": { platforms: { android: null, ios: null } }
  },
  assets: ['./src/assets/fonts']
};

Tags:

React Native