React Native Cookbook
上QQ阅读APP看书,第一时间看更新

How it works...

The vector-icons package that comes with Expo provides access to 11 full icon sets. All you have to do is import the associated component (for example, the FontAwesome component for Font Awesome icons) and provide it with the name that corresponds to the icon in the set that you'd like to use. You can find a full, searchable list of all the icons you can use with the vector-icons helper library in the vector-icons directory, hosted at https://expo.github.io/vector-icons/. Simply set the element's name property to the icon name listed in the directory, add size and color properties, and you're done!

As the GitHub README for vector-icons states, this library is a compatibility layer created for using the icons provided by the react-native-vector-icons package in Expo. You can find this package at https://github.com/oblador/react-native-vector-icons. If you are building a React Native app without Expo, you can get the same functionality by using the react-native-vector-icons library instead.