Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add custom font in react-native v0.69.1 and react v18.0.0

I'm very new to react-native, I've searched a lot about this, but it seems that link has been removed in react-native V0.69.1. I don't know how to link custom fonts in my project. project structure:

android
ios
src
|___assets
       |___fonts/all of my fonts with '.ttf'

I've created react-native.config.js at the root of my project with:

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

and created a <Text style={{fontFamily: 'Splash-Regular',}}>some text</Text> but no luck!

enter image description here

like image 998
Amir Meimari Avatar asked Oct 19 '25 12:10

Amir Meimari


1 Answers

Run npx react-native-asset command instead of npx react-native link. As the link and unlink command is deprecated for the react native version 0.69

like image 69
Manoj Kumar Avatar answered Oct 21 '25 02:10

Manoj Kumar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!