-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
umi4如何调用getDvaApp或者有没有别的方法 #12190
Comments
由于缺乏足够的信息,我们暂时关闭了该 Issue。请修改(不要回复) Issue 提供最小重现以重新开启。谢谢。 |
你是指从 umi 导入找不到 另一个是 max ( 如果你要用 umi ,并且想用 dva ,就需要手动配置,参考:使用插件 如果你用 max ,直接配置 注:dva 、use request 等属于上古数据流方案,为了兼容旧项目升级所以保留下来了,但已经很多年不更新了,现代数据流更推荐使用 jotai / valtio 管理全局状态,使用 react-query / swr 管理请求状态,而不再使用与 redux 相关的工具。 |
请问这里的管理请求状态是啥意思?是指请求loading吗 @fz6m |
现代请求库帮你 管理了请求的 loading 态、避免竟态问题、失败自动重试、自动重新请求 等,不使用请求库项目的体验会很差,所以绝大多数项目都会使用请求库,比如 swr / react-query 。 |
import { getDvaApp } from 'umi';
const dispatch = getDvaApp()._store.dispatch;
The text was updated successfully, but these errors were encountered: