CJY0208 / react-router-cache-route

Route with cache for react-router V5 like <keep-alive /> in Vue
https://www.npmjs.com/package/react-router-cache-route
MIT License
1.15k stars 111 forks source link

不适配react-dom和react v17版本 #126

Closed zhoujiae closed 2 years ago

zhoujiae commented 3 years ago

react-dom和react v17版本使用react-router-cache-route报错 You should not use <withRouter(CacheSwitch) /> outside a

ylwbl commented 3 years ago

react-dom和react v17版本使用react-router-cache-route报错 You should not use <withRouter(CacheSwitch) /> outside a

这个问题和这个库无关,只是withRouter需要在Router外面使用吧

zhoujiae commented 2 years ago

我确实是这样做的,但还是提示错误,安装react v16版本不会报错

CJY0208 commented 2 years ago

可能是不同 react-router 的版本共存导致的,和库无关,需要注意检查一下是否存在多个 react-router 版本,先关了