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

Hack <KeepAlive /> for React

Results 69 react-activation issues
Sort by recently updated
recently updated
newest added

1. 会包含不属于 KeepAlive 上传的内容 内部使用 fixedContext 维护所有已渲染过的 Context,如果页面渲染了包含 Context 的内容,那么在后续渲染 组件的时候实际 会包含 Context 的内容。 相关 [DEMO](https://codesandbox.io/s/react-activation-context-h2g74t?file=/src/App.js) > 复现流程:先访问子页面 B 刷新页面,然后切换到页面 A,可以看到页面 A 的 Keeper 渲染被包含在了页面 B 内部 Context 内 ```...

未使用缓存的时候,切换路由组件会销毁,里面的Modal也会跟着销毁。 使用缓存,目前方案是在useUnactivate这个钩子中设置控制Modal显隐的state为false,但是发现并不生效,Modal并未销毁,state未更新。是离开后就没法更新组件状态了吗?大佬有啥好的解决办法吗,手动控制路由跳转前销毁Modal不太行 ```tsx useUnactivate(() => { setShowDialog(false); console.log('路由缓存隐藏啦', currentRoute); console.log(getCachingNodes()); }); useEffect(() => { console.log('showDialog变化了', showDialog); }, [showDialog]); {showDialog && ( console.log('关闭啦')} visible={staffModalVsb3} footer={null} width={1060} onCancel={() => setStaffModalVsb3(false)} > )}...

```javascript const aliveController = useAliveController() window.aliveController = aliveController ``` ```javascript const initQianKun = () => { renderWithQiankun({ // 文档 https://qiankun.umijs.org/zh/guide/getting-started# mount(props: any) { console.log('QMS子应用开始挂载......') const { container, namespace } =...

大佬们,我这个每次首次切换回缓存页面都没数据,需要重新触发请求才有数据,并且清除缓存后再点开页面会有上一次的搜索数据缓存,有人知道怎么回事吗。。。 ![image](https://github.com/CJY0208/react-activation/assets/115451006/cbfb0024-7c37-4685-9723-0cc1b963c1b1)

@CJY0208 你好 请问一下。切换路由或者说切换tabs拦总会闪一下,有什么办法可以避免么?

用KeepAlive包裹的路由下面,如果包含antd table组件,那将无法使表格横向滚动scroll失效,而且表格的宽度超出布局,有人遇到过吗?

{activePans.map((pane) => { const key = `${pane.id}${pane.key}`; const content = reactComponent return ( {content} ); })}

1.} /> 2.} /> 这两种写法都无效,也就是说saveScrollPosition={false}属性无效,scroll位置还是被保存了,但是我不想缓存这个组件以及它的scroll

由于业务要求,需要详情页根据参数缓存,可以打开很多详情页面缓存 目前出现问题重复点击当前路由出现空白 "antd": "^5.3.2", "react": "^18.2.0", "react-activation": "^0.12.4", "react-dom": "^18.2.0",

**问题描述:** 引用qiankun,在slaveapp的BasicLayout初始化PermissionContext用于控制页面子元素的权限;在uViewShell中useContext获取权限只读属性,状态正确;在uViewButton中useContext获取权限只读属性,状态错误。 层级关系如下: - BasicLayout: true[Provider] -- uViewShell: true [Consumer] --- uViewButton: false[Consumer] 主应用页面: ![image](https://user-images.githubusercontent.com/51627103/232791140-c204cee1-62e8-4aaf-8b40-81da0d0f54d0.png) 子应用页面: ![image](https://user-images.githubusercontent.com/51627103/232791250-45019009-39c4-4515-ada4-9decc13a5cc9.png) 点击button跳转子应用的子模块:**button中初始状态正确** ![image](https://user-images.githubusercontent.com/51627103/232791378-90b733a3-ed94-457f-a2bc-d8e97db7e9d7.png) 点击F5刷新页面:**button中状态错误** ![image](https://user-images.githubusercontent.com/51627103/232791530-32674d3b-2e9e-4901-9d14-9fae811ea552.png) **最简实现代码:** [mainapp.zip](https://github.com/CJY0208/react-activation/files/11262137/mainapp.zip) [slaveapp.zip](https://github.com/CJY0208/react-activation/files/11262150/slaveapp.zip)