反应可加载而不是预加载的组件

我正在使用react loadable进行代码拆分,并不断出现以下错误:

index.js?0a70:36 Uncaught (in promise) TypeError: Cannot read property 'then' of undefined
    at load (index.js?0a70:36)
    at init (index.js?0a70:121)
    at flushInitializers (index.js?0a70:310)
    at eval (index.js?0a70:322)
    at new Promise (<anonymous>)
    at Function.Loadable.preloadAll (index.js?0a70:321)
    at window.onload (app.js?ff8e:23)

我的应用程序文件如下所示:

const render = (Routes,client) => {
  window.onload = () => {
  Loadable.preloadAll().then(() => {
  ReactDOM.render(
    <Application Routes={Routes} client={client} />,document.getElementById('root')
  )
  })
  }
}

什么会导致此preloadAll不确定?我也尝试过preloadReady,但没有成功。

ashinelee 回答:反应可加载而不是预加载的组件

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2991534.html

大家都在问