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

ant design pro + mako,类组件热更新无效果 #1757

Closed
sjm-study opened this issue Jan 14, 2025 · 1 comment
Closed

ant design pro + mako,类组件热更新无效果 #1757

sjm-study opened this issue Jan 14, 2025 · 1 comment

Comments

@sjm-study
Copy link

Describe the bug

ant design pro后台项目原本是UMI3的,用@umijs/max 升级至 UMI4,并开启mako构建,修改类组件代码,虽然页面自动刷新了,但是实际没有改变,需要手动刷新才能看到效果。函数组件却没有这个问题

Reproduction

@ant-design/pro-cli:1.0.28
@umijs/max:4.4.4

mako.config.json配置如下
`
{
"react": {
"runtime": "automatic",
"pragma": "React.createElement",
"import_source": "react",
"pragma_frag": "React.Fragment"
},
"hash": "true",
"devtool": false,
"codeSplitting": {
"strategy": "granular",
"options": {
"frameworkPackages": [
"react",
"react-dom",
"react-router",
"react-router-dom",
"history",
"scheduler",
"xlsx",
"file-saver",
"jszip"
],
"libMinSize": 160000
}
}
}

`

Logs

No response

Severity

annoyance

Additional Information

No response

@sorrycc
Copy link
Member

sorrycc commented Jan 14, 2025

it's by design, class component don't support "fast refresh", please use function component.

@sorrycc sorrycc closed this as completed Jan 14, 2025
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

2 participants