Comments (14)
可能是 react-router
的 withRouter
在 ie9 / ie10 下有什么暗病,如果目前降版本能用的话,就先用着啦,最近忙业务一直没时间看
因为 1.4.2
是为了兼容 react-router
v4.4+ 的修复版本,如果项目中 react-router
版本没有达到 4.4 的话,是不需要升级到 1.4.2
的
这条 issues 先保持开启吧,后续尝试能否无感知修复掉,正好也做个解法标记,谢谢你们啦
from react-router-cache-route.
使用Switch正常,使用CacheSwitch就会报错,例子也是按demo写的
from react-router-cache-route.
其他浏览器如 chrome
功能正常吗?能否提供可复现的最小 demo
片段呢
from react-router-cache-route.
from react-router-cache-route.
OK,感谢反馈!近期会尝试解决
from react-router-cache-route.
好的,非常感谢
from react-router-cache-route.
Hello,看来看去有些奇怪
<CacheSwitch>
的工作方式为继承 <Switch>
并重写了 render
方法,上述报错是出现在 <Switch>
的原有 render
方法中
按理来说,重写 render
方法后,使用 <CacheSwitch>
时无论如何都不应该出现上述报错才对
除非使用了旧版本的 <Switch>
,报错并不是在其 render
方法中输出
我猜测可能是某种未知的兼容性问题,但缺乏更多有效的信息,能否提供完整的 Demo
目录呢?
可以加我 QQ:375564567 以压缩包形式提供,或者在此处张贴全部 Demo
代码
另外需要知晓 Demo
中的 react
、react-dom
、react-router
版本号,十分感谢!
from react-router-cache-route.
我也遇到这个问题,除了ie9和ie10有这个问题,其他现代浏览器都没有这个问题
from react-router-cache-route.
测试后"react-router-cache-route": "^1.4.1" 没问题,"react-router-cache-route": "^1.4.2"存在这个问题
from react-router-cache-route.
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-router": "^4.1.1",
"react-router-dom": "^4.1.1",
"react-router-cache-route": "^1.3.1",
edge下是可以的,之前也一直用的可以的,是后面突然不行的
from react-router-cache-route.
@zxfgll 那我也测试下
from react-router-cache-route.
@CJY0208 大大,这边删包重新install可以了,不确定是不是是版本,但是之前确实用了半年很赞,也没有报错哦
from react-router-cache-route.
好的
from react-router-cache-route.
@huiBuiling @zxfgll
v1.4.3 尝试识别 router-router
v4.4+ 特征来决定是否使用 withRouter
包裹 CacheSwitch
组件,在版本低于 4.4 时不会使用 withRouter
可以试试看,是否修复了当前 Issues
from react-router-cache-route.
Related Issues (20)
- CacheRoute pathname prop is gone HOT 5
- push和replace时不使用已经缓存的页面 HOT 2
- 记录启用 multiple 时 href 中有中文的一个 BUG 及解决方案 HOT 2
- 用react 17 的ReactDOM.render(), 缓存成功, 但不支持react 18的版本 ReactDOM.createRoot() 缓存失败,请问有兼容方案? HOT 6
- 带参数详情页面多份数据缓存如何做? HOT 4
- 带有参数的页面,离开页面的时候useParams会返回undefined,导致无法维持原来的页面组件状态 HOT 3
- 请问下作者如何处理跳转路径完全相同,但是state不同的情况 HOT 2
- 路由里存在中文,路由会缓存2份
- 开启multiple后,带querystring的路由缓存失败
- 请问 在cache-route中如何实现仅在切换路由列表时卸载当前页面组件 谢谢 HOT 1
- `CacheSwitch` re-mount the same component if path changes HOT 1
- item/detail/:id 这种带参数的路由缓存不了,
- 在路由back后,怎么让缓存的组件不重新render呢? HOT 1
- 怎么实现头部Tabs页签的效果?能否提供一些示例? HOT 1
- How to turn off the display:none of the component HOT 5
- 使用CacheRoute缓存路由,出现闪烁
- 【咨询】为什么 Updatable 内部的 Freeze 需要 Delay 1s HOT 2
- CacheSwitch不会触发Suspense的fallback HOT 3
- iframe嵌套状态保留
- 打包部署后报错 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-router-cache-route.