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.14k stars 110 forks source link

push和replace时不使用已经缓存的页面 #149

Closed LWW994214671 closed 1 year ago

LWW994214671 commented 2 years ago

楼主你好,我现在遇到一个问题,就是在A页面已经缓存的时候,从其他页面push或者replace到这个A页面,会直接使用缓存的页面进行显示,页面不会刷新,除了使用didrecover来手动刷新数据是否有其他办法解决??

houchaowei commented 1 year ago

遇到了同样的问题,使用了cache-router 在使用history.push的时候,页面不会自动销毁

CJY0208 commented 1 year ago

可以在 push 或 replace 前,先手动卸载掉对应页面的缓存