react-activation icon indicating copy to clipboard operation
react-activation copied to clipboard

Hack <KeepAlive /> for React

Results 88 react-activation issues
Sort by recently updated
recently updated
newest added
trafficstars

```js @withActivation class WorkerOrderList extends React.Component { componentDidActivate() { ... } } export default connect(({ workOrder }) => ({ softEnum: workOrder.softEnum, }))(WorkerOrderList); ``` 报错:You must pass a component to the...

我们的项目使用了react-activation的keep-alive组件,以及在keep-alive组件内使用material-table,如果material-table使用fixedColumn的话,固定列的遮罩表格会无法渲染。我们查阅了material-table的源代码,它会使用this.tableContainerDiv的scrollWidth去设定一个宽度,在正常情况下,这个宽度是有值的,但是如果使用keep-alive包裹material-table的话,这个宽度的值只有初始值0,不清楚是react-activation导致的还是material-table导致的问题。 代码类似 ![image](https://user-images.githubusercontent.com/1860731/140021564-f36761e6-1ae8-46c3-839c-27afe3ecb126.png) 正常情况 ![image](https://user-images.githubusercontent.com/1860731/140022632-c22679ce-bc51-4ef3-ac64-b4dd745e8d3f.png) 使用keep-alive会出现此情况 ![image](https://user-images.githubusercontent.com/1860731/140021662-930e6281-e602-43a0-95aa-5469f7b05dd4.png) 无法判断是activation问题还是material-table问题

先列举一下根据代码总结的处理流程: 1.KeepAlive mount阶段 - 1.组件A使用 KeepAlive 缓存 - 2.KeepAlive 首次渲染,Constructor 中 init 函数初始化,调用 props._helpers.keep 缓存组件 - 3.helper.keep处理缓存并触发AliveScopes render, 只有当Keeper mount之后,才会在AliveScope的store中添加keeper实例的cache对象 2.KeepAlive unmount阶段 - 1.KeepAlive unMount时,根据id将store中对应的cache.cached置为true - 2.drop/dropScope 清理缓存时,需要检查cached是否为true 问题出mount阶段的 2...

比如现在有 `用户管理` 和 `角色管理` 两个tab,保存代码更新之后,会变成 `用户管理` 、`角色管理` 、`角色管理`这样。 追加了一次当前路由。 umi的更新没有刷新浏览器,好像是重新渲染了一次界面。 ![image](https://user-images.githubusercontent.com/9713892/105684348-ca799780-5f2f-11eb-973f-0dd4be43617c.png)

@CJY0208 请问如何动态设置名字,我目前这样实现不行 1、通过getCachingNodes获取cachingNodes后,循环生成tabs, 2、通过接口获取数据后需要更新KeepAlive的自定义属性data-pathName={tabName} 3、再通过getCachingNodes重新获取的,但还是之前的名字

和 @CHEN-J-H 在微信的问题反馈中得知存在此问题,当代码中存在类似如下操作时,造成组件不渲染 猜测原因为,drop 动作是异步的,但目前和 push 同步调用了,造成了,push 先执行后,drop 生效,KeepAlive 内部的 dom 操作(inject/eject)出现了问题 此处做记录,后续修复

bug

刚刚从cra转vite,发现不支持babel配置,请问如何使用这个库呢?

用KeepAlive包裹的组件中,可以获取到pathname,但无法获取params。 具体描述如下: Route的path: '/playlist/:id',我访问‘/playlist/12345’, react-router-dom有useLocation和useParams这两个hooks,用useLocation获取到{pathname:"/playlist/12345,...},而useParams只能获取到空对象。用withRouter的效果也是一样的,props.match.params也是空对象。 不包裹KeepAlive则一切正常。

here is code of my page: ```js render() { const { query: { random_key } } = this.props return ( ) } ``` Rehydrated page must matches the original SSR'ed...

bug
help wanted