React Native + Redux Orm无法在“Connect(截图)”的上下文或道具中找到“store”

时间:2017-07-14 02:43:03

标签: firebase react-native redux react-native-navigation

我遇到过关于此的多个主题,但未能找到解决方案。其中大多数是针对网络应用程序。我非常感谢任何帮助。感谢你。

I have created a repo for my code.

的package.json

  "dependencies": {
    "lodash": "^4.17.4",
    "native-base": "^2.2.1",
    "react": "16.0.0-alpha.12",
    "react-native": "0.46.1",
    "react-native-firebase": "^2.0.2",
    "react-native-navigation": "^1.1.134",
    "react-redux": "^5.0.5",
    "redux": "^3.7.1",
    "redux-orm": "^0.9.4",
    "redux-persist": "^4.8.2",
    "redux-thunk": "^2.2.0"
  },
  "devDependencies": {
    "babel-jest": "20.0.3",
    "babel-preset-react-native": "2.1.0",
    "jest": "20.0.4",
    "react-test-renderer": "16.0.0-alpha.12",
    "redux-immutable-state-invariant": "^2.0.0",
    "redux-logger": "^3.0.6",
    "redux-orm-proptypes": "^0.1.0"
  },
  "jest": {
    "preset": "react-native",
    "verbose": true,
    "testPathIgnorePatterns": [
      "/node_modules/",
      "__tests__/factories",
      "__tests__/utils"
    ]
  }

enter image description here

1 个答案:

答案 0 :(得分:0)

running again中,您使用构造函数设置的默认src/main.js调用<Provider>的初始呈现,this.state.store

相反,创建商店并将其作为道具传递给null组件,因此它始终具有值。或者在构造函数中创建商店(不太好,但会起作用)