In the final section of this chapter, you'll learn how to render icons in React Native components. Using icons to indicate meaning makes web applications more usable. So, why should native mobile applications be any different?
You'll want to use the react-native-vector-icons package to pull in various vector font packages into your React Native project, as follows:
npm install --save @expo/vector-icons
Now, you can import the Icon components and render them. Let's implement an example that renders several FontAwesome icons based on a selected icon category:
import React, { useState, useEffect } from "react";
import { View, Picker, FlatList, Text } from "react-native";
import Icon from "react-native-vector-icons/FontAwesome";
import styles from "./styles";
import iconNames from "./icon-names.json";
export default function RenderingIcons() {
const [selected, setSelected] = useState("Web Application Icons"...