前提准备
1.安装react-native-vector-icons
yarn add react-native-vector-icons
2.如果你想使用库中的默认字体文件,则需要链接资源库(可选)
react-native link react-native-vector-icons
3.重新运行项目
4.测试运行一下代码在任意组件 (这里使用的是react-native-vector-icons库自带的图标
import Icon from 'react-native-vector-icons/FontAwesome';
<Icon name="rocket" size={30} color="#900" />