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

可以属性控制去掉CacheRoute渲染出来的div节点吗? #124

Closed vivianus-chan closed 2 years ago

vivianus-chan commented 2 years ago

1629252981(1)

CJY0208 commented 2 years ago

这层 div 是用来统一增加 display: none 属性的,去掉的话就隐藏不了东西了,可以考虑用属性控制它是 div 还是 span 之类的

TwilightOwl commented 2 years ago

Yeah! This extra div element breaks component's layout in my case :(

CJY0208 commented 2 years ago

@TwilightOwl use className prop to fix your style

<CacheRoute className="custom-class" />
CJY0208 commented 2 years ago

closed