我正在尝试根据 https://wix.github.io/react-native-navigation/#/docs/Installing 将Wix导航库添加到我的项目中,但是当我在终端中运行npm install --save react-native-navigation
命令,然后在Android Studio中打开我的Android项目时,我在我的项目中看不到任何用于导航的库模块。但是 react-native-navigation 的名称将出现在 package.json 文件中。
这是我的package.json文件:
{
"name": "PleaseAnswer",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.6.3",
"react-native": "0.57.8",
"react-native-navigation": "^2.5.0"
},
"devDependencies": {
"babel-jest": "23.6.0",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.51.1",
"react-test-renderer": "16.6.3"
},
"jest": {
"preset": "react-native"
}
}
-
Android
:如果您使用的是 V2 版本,则react-native link
不会自动将您的软件包链接到 Android。我建议您遵循文档 https://wix.github.io/react-native-navigation/#/docs/Installing -
iOS
:我建议您使用cocoapods
进行iOS配置
在pod文件中添加pod 'ReactNativeNavigation', :path => '../node_modules/react-native-navigation'
并运行pod install