reactjsreact-nativewebstormnpxreact-native-linking

npx react-native link dose not working for me


I'm trying to use this (https://mehrankhandev.medium.com/ultimate-guide-to-use-custom-fonts-in-react-native-77fcdf859cf4) to add font but I have problem with this part...

npx react-native link

this command don't shows anything to me... anything; and then console line "C:\Users****\WebstormProjects\myFirstProject> appears again. like I didn't wrote any command at first. what's wrong?


Solution

  • You need to create a react-native.config.js then you can use react-native link command.

    Example:

    module.exports = {
        project: {
            ios: {},
            android: {},
        },
        assets: ['./src/assets/fonts/Montserrat', './src/assets/fonts/Nunito', './src/assets/fonts/Newsreader', './src/assets/fonts/Anton', './src/assets/fonts/Gilroy'],
    };