kadikraman / react-native-beyond-basics

Intermediate React Native course material
https://kadikraman.github.io/react-native-beyond-basics/
58 stars 21 forks source link

[Solution] npx react-native link for RN versions >= 0.69 #4

Open ezrahnyanat opened 2 years ago

ezrahnyanat commented 2 years ago

In the Custom Fonts section of the course, we add the custom font to the project and link it with npx react-native link. But apparently link has been removed (see here).

Solution is npx react-native-asset

Also, change the path in react-native.config.js to ./src/assets/fonts

Raidro commented 2 years ago

it didn't work for me. I installed react-native-asset but when I tried to execute the command react-native-asset it's says command not found

JHPG commented 2 years ago

In the Custom Fonts section of the course, we add the custom font to the project and link it with npx react-native link. But apparently link has been removed (see here).

Solution is npx react-native-asset

Also, change the path in react-native-config.js to ./src/assets/fonts

There is a typo in the file name, the correct name is react-native.config.js

The file example:

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