懒惰反应并更换减速器

时间:2019-02-21 03:33:46

标签: reactjs redux react-redux

我有一个反应懒惰的组件,它会根据路由在其中加载。

现在,我要实现动态减速器。因此,我创建了一个商店,其中的异步对象包装在方法中。

示例模型代码:

const wrappedComp = () => {
  import(reducerpath).then(resp => {
    store.injector("reducerkey", resp)
  })
  return React.lazy(componentPath)
}

当我使用上述模型时,在创建reducer之前,要加载组件。请问减速器第一个要装什么解决方案。

0 个答案:

没有答案
相关问题