0

我遇到了多个关于此的线程,但未能找到解决方案。其中大部分用于网络应用程序。我将不胜感激任何帮助。谢谢寻找。

我为我的代码创建了一个仓库。

包.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"
    ]
  }

在此处输入图像描述

4

1 回答 1

0

src/main.js中,您的初始渲染<Provider>是使用构造函数设置的默认值调用的this.state.store,即null.

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

于 2017-07-14T05:48:38.127 回答