mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-23 15:08:34 +08:00
fix: useResetIconStyle is being called repeatedly
This commit is contained in:
parent
cd10dc0a7e
commit
db551189b7
@ -6,7 +6,6 @@ import { ConfigContext } from '../../config-provider/context';
|
|||||||
import { genCommonStyle, genLinkStyle } from '../../style';
|
import { genCommonStyle, genLinkStyle } from '../../style';
|
||||||
import type { AliasToken, ComponentTokenMap, SeedToken } from '../interface';
|
import type { AliasToken, ComponentTokenMap, SeedToken } from '../interface';
|
||||||
import useLocalToken, { unitless } from '../useToken';
|
import useLocalToken, { unitless } from '../useToken';
|
||||||
import useResetIconStyle from './useResetIconStyle';
|
|
||||||
|
|
||||||
export const { genStyleHooks, genComponentStyleHook, genSubStyleComponent } = genStyleUtils<
|
export const { genStyleHooks, genComponentStyleHook, genSubStyleComponent } = genStyleUtils<
|
||||||
ComponentTokenMap,
|
ComponentTokenMap,
|
||||||
@ -28,11 +27,7 @@ export const { genStyleHooks, genComponentStyleHook, genSubStyleComponent } = ge
|
|||||||
return { theme, realToken, hashId, token, cssVar };
|
return { theme, realToken, hashId, token, cssVar };
|
||||||
},
|
},
|
||||||
useCSP: () => {
|
useCSP: () => {
|
||||||
const { csp, iconPrefixCls } = useContext(ConfigContext);
|
const { csp } = useContext(ConfigContext);
|
||||||
|
|
||||||
// Generate style for icons
|
|
||||||
useResetIconStyle(iconPrefixCls, csp);
|
|
||||||
|
|
||||||
return csp ?? {};
|
return csp ?? {};
|
||||||
},
|
},
|
||||||
getResetStyles: (token) => [{ '&': genLinkStyle(token) }],
|
getResetStyles: (token) => [{ '&': genLinkStyle(token) }],
|
||||||
|
Loading…
Reference in New Issue
Block a user