小编bbr*_*sky的帖子

"错误:错误:错误:错误:在执行reducer时,您可能无法调用store.getState()."

我刚刚将我的全功能react-native应用程序升级到redux v4,但现在我收到以下错误:

错误:错误:错误:错误:在reducer执行时,您可能无法调用store.getState().减速器已经作为一个论点得到了国家.将它从顶部减速器传下来,而不是从商店中读取.

我怀疑问题是我在其他组件中有很多组件,每个组件都有自己的组件connect(mapStateToProps, mapDispatchToProps)(Component),我认为这不是实现它的正确方法,尽管我不确定正确的方法.

任何方向都非常感谢!

堆栈跟踪:

    This error is located at:
    in Connect(SideBarApp) (at SceneView.js:9)
    in SceneView (at createTabNavigator.js:10)
    in RCTView (at View.js:43)
    in RCTView (at View.js:43)
    in ResourceSavingScene (at createBottomTabNavigator.js:86)
    in RCTView (at View.js:43)
    in RCTView (at View.js:43)
    in TabNavigationView (at createTabNavigator.js:127)
    in NavigationView (at createNavigator.js:59)
    in Navigator (at createNavigationContainer.js:376)
    in NavigationContainer (at SceneView.js:9)
    in SceneView (at SwitchView.js:12)
    in SwitchView (at createNavigator.js:59)
    in Navigator (at createNavigationContainer.js:376)
    in NavigationContainer (at AppNavigator.js:36)
    in App (created by Connect(App))
    in …
Run Code Online (Sandbox Code Playgroud)

redux react-redux

65
推荐指数
6
解决办法
1万
查看次数

节点应用程序无法使用clang进行安装:警告:使用sysroot进行"iPhoneSimulator"但针对"MacOSX"[-Wincompatible-sysroot]

我在同一系统上做节点和iOS开发,并怀疑可能是问题的原因:

error /Users/ben/Desktop/app/node_modules/libpq: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /Users/ben/Desktop/app/node_modules/libpq
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@6.11.4 | darwin | x64
gyp info spawn /usr/local/bin/python2
gyp info spawn args [ '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/ben/Desktop/app/node_modules/libpq/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args …
Run Code Online (Sandbox Code Playgroud)

node.js node-gyp yarnpkg

5
推荐指数
1
解决办法
1673
查看次数

标签 统计

node-gyp ×1

node.js ×1

react-redux ×1

redux ×1

yarnpkg ×1