Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 1.31 KB

SETUP-EXPO.md

File metadata and controls

35 lines (27 loc) · 1.31 KB

Setup guide for Expo Apps

If you use React Native without Expo, please follow this guide instead. This guide applies to Expo native apps only.

react-native-vector-icons supports Expo, and no further steps are required for native platforms, but you can optionally follow the steps below to set up the font config plugin. For web, see the web setup guide.

Set up font config plugin

This is optional but recommended because through the config plugin, the icon font will be available in the app since build time, rather than being loaded at runtime - see more.

You need to use prebuild, to be able to use config plugins.

  1. In your app.config.json / js, add the following:
module.exports = {
  "expo": {
    "plugins": [
      [
        "expo-font",
        {
          "fonts": [
            "./node_modules/@react-native-vector-icons/<font-package>/fonts/<font-file>.ttf",
            // example:
            "./node_modules/@react-native-vector-icons/simple-line-icons/fonts/SimpleLineIcons.ttf"
          ]
        }
      ]
    ]
  }
}
  1. Run npx expo prebuild --clean.
  2. Rebuild the app: npx expo run:ios or npx expo run:android.