Custom Fonts with React-Native
Working on an app in react-native and want to import you own fonts? Here's how to set it up.
- Add your font files to your project. I'll use
./assets/fonts/
-
Create a react-native.config.js at the project root.
module.exports = { project: { ios: {}, android: {}, }, assets: ['./assets/fonts/'], }
-
Use the fonts in your styles.
title: { textAlign: 'center', fontSize: 18, fontFamily: 'Nunito Sans, sans-serif', fontWeight: 'bold', marginBottom: 10, },