项目环境配置
1.在对应的工程根目录下安装react navigation npm install --save react-navigation
2.安装与顶部tab手势操作相关的第三方库 npm install --save react-native-gesture-handler
可以根据需要,安装第三方的矢量图标库: npm install --save react-native-vector-icons
附:npm install、npm install --save与npm install --save-dev区别
3.将第三方库中与native相关的代码关联到react native中
react-native link react-native-gesture-handler
react-native link react-native-vector-icons
使用AS打开项目的Android部分,settings.gradle可能会提示路径有问题 project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '..\node_modules\react-native-vector-icons\android')
在每个反斜杠后面再加一个反斜杠,取消转义即可。