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.16k stars 113 forks source link

v1.12.5 在 useDidCache hook 里解绑 document.body 上的事件不生效 #142

Closed aiyogg closed 2 years ago

aiyogg commented 2 years ago

导致在 useDidRecover 中绑定的事件无法解绑

aiyogg commented 2 years ago

额,问题找到了,定义在FC里的函数作为 Listener 得加上 useCallback,不然每次解绑的不是同一个 Listener