-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
umi@4已发布,请问会兼容吗? #63
Comments
会兼容,目前只有这一个问题吗? keep alive 功能是否正常呢 |
|
@yuantongkang PR 合并了,发了 beta.33 可以试试,感谢~ |
欢迎试用 react-fiber-keep-alive,一个基于 react fiber 的 keep-alive 实现 |
0.0.1-beta.34 在umi4中还是使用不了,报错信息同上 |
@1769762790 需要自检下 node_modules 里的版本是否确实已经升级到 beta.34,看了代码应该不会有这个报错的 |
目前看插件实现是加在rootContainer这一层,在路由之外,这个是否存在潜在问题? 与使用addLayout加在router之内的区别是? @CJY0208 |
import { useAliveController } from '@umijs/max' |
可以参考这个例子: pnpm add umi-plugin-keep-alive --save; pnpm add react-activation; plugins: ['umi-plugin-keep-alive'], 3.遇到问题:但是只要在使用了useModel的页面,再使用KeepAlive,都会报错:Uncaught TypeError: Cannot read properties of null (reading 'dispatcher')(没有使用useModel的页面,没有报错)。后来在gitHub查到还需要添加一个配置: src/app.ts中添加如下配置: import { autoFixContext } from 'react-activation'; autoFixContext( import { KeepAlive } from '@umijs/max'; |
[email protected] 已发布 -> https://github.com/umijs/umi-next
当前最新版本的umi-plugin-keep-alive不兼容,useAliveController等方法无法从umi中直接导出
The text was updated successfully, but these errors were encountered: