【问题标题】:App.router must be provided to createNavigationPropConstructorApp.router 必须提供给 createNavigationPropConstructor
【发布时间】:2018-12-04 00:27:28
【问题描述】:

我在将 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 提供给 createNavigationPropConstructor。了解更多: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)
    

【问题讨论】:

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


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2020-11-26
      • 1970-01-01
      • 1970-01-01
      • 2019-08-13
      • 1970-01-01
      • 2017-10-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多