CJY0208 / react-activation

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

用Keeplive包含了每个组件,传了name,在反复切换路由时,cachingNodes每次都会新增一个节点。并产生一个新id,请问下这个是什么原因? #281

Closed shawnliuchenyang closed 1 year ago

CJY0208 commented 1 year ago

name 类似 className,不是唯一值,如果需要使用唯一值,可以使用 id 或者 cacheKey 属性,参考 https://github.com/CJY0208/react-activation/blob/master/README_CN.md#%E5%A4%9A%E4%BB%BD%E7%BC%93%E5%AD%98