反应导航 - “无法读取未定义的属性'状态',即使已安装并链接了手势处理程序

问题描述 投票:0回答:1

问题

当我在React Navigation中尝试使用堆栈导航器时,我收到错误“无法读取未定义的属性'状态'。 Switch和bottomTabNavs工作得非常好。

如果有人知道如何解决这个问题,这将是惊人的!

我试过的

我已经检查过以确保react-native-gesture-handler安装并正确链接。

环境

的package.json

{
  "name": "app",
  "version": "5.1.0",
  "private": true,
  "devDependencies": {
    "babel-jest": "23.6.0",
    "fs-extra": "^6.0.1",
    "jest": "23.6.0",
    "metro-react-native-babel-preset": "0.49.2",
    "react-test-renderer": "16.7.0",
    "reactotron-react-native": "^3.2.0",
    "replace-in-file": "^3.4.2"
  },
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios --simulator=\"iPhone X\"",
    "apk": "cd android && ./gradlew assembleRelease",
    "rename": "node ./bin/rename.js",
    "start": "react-native start",
    "test": "jest"
  },
  "jest": {
    "preset": "react-native"
  },
  "dependencies": {
    "axios": "^0.18.0",
    "lodash": "^4.17.11",
    "react": "16.6.3",
    "react-native": "0.58.0-rc.2",
    "react-native-firebase": "^5.2.0",
    "react-native-gesture-handler": "^1.1.0",
    "react-native-rate": "^1.1.6",
    "react-native-sensitive-info": "5.2.9",
    "react-native-splash-screen": "^3.2.0",
    "react-native-status-bar-height": "^2.3.1",
    "react-native-table-component": "^1.2.0",
    "react-navigation": "^3.3.2"
  }
}
```[![enter image description here][1]][1]


  [1]: https://i.stack.imgur.com/8Uqso.png
ios react-native react-navigation
1个回答
0
投票

问题是即使react-native链接指示包已成功链接,也未安装pod文件。

要解决此问题,请按以下步骤操作:

  1. cd ios
  2. Pod安装
  3. 清理ios文件夹
  4. 运行应用程序
© www.soinside.com 2019 - 2024. All rights reserved.