Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use different fonts (more than one) of react-native-vector-icons in one file?

How to use 2 or more fonts (for example, FontAwesome and Entypo) of the react-native-vector-icons in one file?

like image 721
Eduard Avatar asked Sep 14 '25 07:09

Eduard


1 Answers

react-native-vector-icons exports a default <Icon /> component. You can name your default imports anything you want. For your example you can do:

import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome'
import EntypoIcon from 'react-native-vector-icons/Entypo'

This way you can use as many fonts as you want

like image 91
Kyle Roach Avatar answered Sep 15 '25 21:09

Kyle Roach