-
Notifications
You must be signed in to change notification settings - Fork 581
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
Fix/button icon loading not working #555
Fix/button icon loading not working #555
Conversation
packages/icons-react/src/utils.ts
Outdated
const { csp } = useContext(IconContext); | ||
const { csp, prefixCls = 'anticon' } = useContext(IconContext); | ||
|
||
if (typeof prefixCls === "string") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (prefixCls)
就够了,不用做类型判断~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
packages/icons-react/src/utils.ts
Outdated
@@ -142,7 +142,11 @@ export const iconStyles = ` | |||
`; | |||
|
|||
export const useInsertStyles = (styleStr: string = iconStyles) => { | |||
const { csp } = useContext(IconContext); | |||
const { csp, prefixCls = 'anticon' } = useContext(IconContext); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这边不用设置默认值,否则下面 if 总是会走进去
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里之前写的时候删掉了,后来改着改着又加回去了.. 我修正一下
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
fix #40282
💡 Background and solution
📝 Changelog
iconPrefixCls
时,按钮加载图标动画丢失问题☑️ Self-Check before Merge