小编Мил*_*вић的帖子

未捕获的错误:Reducer“usershortcuts”在初始化期间返回未定义

所以我试图在启动应用程序之前初始化 ExtReact 的存储,以便我可以加载数据,使用 Redux 存储更新应用程序的状态。不要被 action 的调用所迷惑,它只是用来通知 reducer 他现在可以加载 store。我正在关注本教程(http://docs.sencha.com/extreact/6.5.0/guides/extreact_stores_in_flux.html)。但我收到此错误:

Uncaught Error: Reducer "usershortcuts" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined. 
Run Code Online (Sandbox Code Playgroud)

所以这些是代码中最重要的部分:

  1. index.js(入口点):

    const store = configureStore();
    
    /* Calling of actions. */
    store.dispatch(usershortcutFetchDataThroughStore());
    
      launch(
      <Provider store = {store}>
          <HashRouter>
            <Switch> …
    Run Code Online (Sandbox Code Playgroud)

javascript reactjs react-redux extreact

2
推荐指数
1
解决办法
2864
查看次数

标签 统计

extreact ×1

javascript ×1

react-redux ×1

reactjs ×1