How to use React Native vector icons?

后端 未结 6 1557
感动是毒
感动是毒 2020-12-24 02:54

I have just installed React Native vector icons with this comand:

npm install react-native-vector-icons

But if I use it in the index.androi

6条回答
  •  悲哀的现实
    2020-12-24 03:17

    First, make sure you're saving the dependency in your project by doing:

    npm install react-native-vector-icons --save. Including the --save is necessary, otherwise react-native link won't be able to locate the module.

    Before you can use them in your iOS or Android project, you also have to link the native modules. The quick way to do this is by using the following command:

    react-native link react-native-vector-icons

    If for any reason you have problems using react-native link to link the native modules, the react-native-vector-icons README also provides detailed instructions for linking them manually on Android and iOS, and integrating the library on the web as well.

提交回复
热议问题