StructureBuilder / react-keep-alive

A component that maintains component state and avoids repeated re-rendering.
MIT License
984 stars 106 forks source link

报错了,是与react-loadable有冲突吗? #3

Closed LastStranger closed 5 years ago

LastStranger commented 5 years ago

image image image image

react-router 4.2.0 react-router-dom4.2.2

ShenChang618 commented 5 years ago

@LastStranger react-router 必须使用最新版本,请使用下面方式安装:npm install react-router react-router-dom。现在的 react-router 最新版是 5.0.0,使用了 new Context API,而 react-keep-alive 也是使用的 new Context API,这样是可以传递数据的,旧的 Context API 不行。

LastStranger commented 5 years ago

还是一样的错误,我不使用react-loadable就是好的

LastStranger commented 5 years ago

我感觉问题就出在react-loadable上, image 我react-router和react-router-dom都是5.0.0,可能keepAlive在react-loadable中不是这样写的

LastStranger commented 5 years ago

之前我直接在LadableAppGetUserInfo外加了一层KeepAlive,然后就报错了

ShenChang618 commented 5 years ago

@LastStranger 很抱歉这么晚回复😂,具体解决方案:With React Loadable