CJY0208 / react-activation

Hack <KeepAlive /> for React
https://www.npmjs.com/package/react-activation
MIT License
1.78k stars 140 forks source link

React 18 中,会清空useRef 吗 #293

Open CurryHan opened 10 months ago

CurryHan commented 10 months ago

发现回到缓存页面,useRef().current为null

CurryHan commented 10 months ago

发现还是跟react18的 createRoot有关,使用ReactDOM.render正常

CurryHan commented 10 months ago

请问有办法修复吗

CJY0208 commented 10 months ago

如果可以的话,希望提供一个在线示例,最近比较忙