mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-19 03:54:28 +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 type { AliasToken, ComponentTokenMap, SeedToken } from '../interface';
|
||||
import useLocalToken, { unitless } from '../useToken';
|
||||
import useResetIconStyle from './useResetIconStyle';
|
||||
|
||||
export const { genStyleHooks, genComponentStyleHook, genSubStyleComponent } = genStyleUtils<
|
||||
ComponentTokenMap,
|
||||
@ -28,11 +27,7 @@ export const { genStyleHooks, genComponentStyleHook, genSubStyleComponent } = ge
|
||||
return { theme, realToken, hashId, token, cssVar };
|
||||
},
|
||||
useCSP: () => {
|
||||
const { csp, iconPrefixCls } = useContext(ConfigContext);
|
||||
|
||||
// Generate style for icons
|
||||
useResetIconStyle(iconPrefixCls, csp);
|
||||
|
||||
const { csp } = useContext(ConfigContext);
|
||||
return csp ?? {};
|
||||
},
|
||||
getResetStyles: (token) => [{ '&': genLinkStyle(token) }],
|
||||
|
Loading…
Reference in New Issue
Block a user