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

`import { useEffect } from 'react'; import { Route, Redirect } from 'react-router-dom'; import { useSelector } from 'react-redux'; import { useAliveController } from 'react-activation'; import { isMicroEnv } from...

{ const { history } = props const location = history.location; if (history.action === 'POP') { console.log(123); return true } console.log(234); return false }} > {children} 已知拿到最新的,但是是否缓存并没有生效

第一次菜单选择页面加载都没得问题 切换tab加载缓存页面会出现两个页面加载一样的内容 尤其是第一和第二个标签 react 18

在React18中打包部署后,KeepAlive**必须具名导入**,默认导入线上会报错"Minified React error #130" ![Image](https://github.com/user-attachments/assets/49f35c6e-9488-4c53-a603-37742d0cdf2d)

ERROR : Uncaught Error: Super expression must either be null or a function when using react-activation in "next": "14.2.5", "react-activation": "^0.13.0", reactStrictMode: false, MY CODE: //app/h5/_components/KeepAliveWrapper.tsx 'use client'; import React...

当前组件的 activate 和 freeze 两个阶段 **组件渲染** 和 **eventBus 执行** 顺序不一致,是否可保持统一 **activate -> freeze:** 先触发 eventBus,等待 1s 触发 freeze(冻结 React 组件) 相关代码:https://github.com/CJY0208/react-activation/blob/master/src/core/Keeper.js#L98-L113 ```javascript this.eventBus.emit(LIFECYCLE_UNACTIVATE) const listeners = [...this.listeners] listeners .reverse() .forEach(([,...