Skip to content
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

umi3 使用plugin-dva,在使用类组件的时候,怎么定义model的类型? #5121

Closed
chinafelix opened this issue Jul 29, 2020 · 2 comments

Comments

@chinafelix
Copy link

image
image

IndexModelState是我自定义在src/models/index.tsx 的一个state接口,用函数式组件时没问题,用类组件就提示类型不兼容,就算用Props接口也没用,不知道该怎么给model定义了

@xiaohuoni
Copy link
Member

可以参考这里的写法 https://github.com/ant-design/pro-blocks/blob/antd%403/AccountCenter/src/index.tsx 只是更简单,很多定义可以从 umi 中取出

@chess99
Copy link

chess99 commented Sep 20, 2023

umi 把 model 里的类型都收集起来一起导出了, 为什么不更进一步聚合一下作为 connect 入参的类型, 省掉还要手动 import ModalState. useSelector 同理.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants