必须提供App.router来创建createNavigationPropConstructor

时间:2018-06-25 12:16:34

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

将react-navigation和redux-helpers库升级到最新版本后,仍然出现此错误,但仍然找不到任何有用的链接。

  • “反应”:“ 16.3.1”,
  • “ react-native”:“ 0.55.4”,
  • “反应导航”:“ ^ 2.3.1”,
  • “ react-navigation-redux-helpers”:“ ^ 2.0.1”,

    不变违规:从react-navigation-redux-helpers@2.0.0起,必须提供App.router来创建navigationpropconstructor。了解更多:https://reactnavigation.org/docs/en/redux-integration.html#breaking-changes-in-2.3

    This error is located at:
        in NavigatorReduxWrapper (created by Connect(NavigatorReduxWrapper))
        in Connect(NavigatorReduxWrapper) (at App.js:27)
        in Provider (at App.js:26)
        in App (at renderApplication.js:33)
        in RCTView (at View.js:60)
        in View (at AppContainer.js:102)
        in RCTView (at View.js:60)
        in View (at AppContainer.js:122)
        in AppContainer (at renderApplication.js:32)
    

1 个答案:

答案 0 :(得分:1)

该错误很可能是由于您上面链接的文档有些不正确且具有误导性,导致对reduxifyNavigator的使用不当,即传递的是普通Component而不是NavigationContainer

查看此解决方案,几周前发布 https://github.com/react-navigation/react-navigation-redux-helpers/issues/44#issuecomment-400480935