From 3146cb49a34108db43c3ae932319f67ab9a9f796 Mon Sep 17 00:00:00 2001 From: wuxh Date: Wed, 26 Apr 2023 15:09:14 +0800 Subject: [PATCH] chore: update --- components/config-provider/index.tsx | 2 +- components/config-provider/style/index.ts | 2 +- components/theme/util/genComponentStyleHook.ts | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/config-provider/index.tsx b/components/config-provider/index.tsx index 1b0e148ce3..5b5cb42da9 100644 --- a/components/config-provider/index.tsx +++ b/components/config-provider/index.tsx @@ -206,7 +206,7 @@ const ProviderChildren: React.FC = (props) => { const shouldWrapSSR = iconPrefixCls !== parentContext.iconPrefixCls; const csp = customCsp || parentContext.csp; - const wrapSSR = useResetIconStyle(iconPrefixCls); + const wrapSSR = useResetIconStyle(iconPrefixCls, csp); const mergedTheme = useTheme(theme, parentContext.theme); diff --git a/components/config-provider/style/index.ts b/components/config-provider/style/index.ts index 0b3a4ff8da..7f9603bac1 100644 --- a/components/config-provider/style/index.ts +++ b/components/config-provider/style/index.ts @@ -4,7 +4,7 @@ import type { CSPConfig } from '..'; import { resetIcon } from '../../style'; import { useToken } from '../../theme/internal'; -export const useResetIconStyle = (iconPrefixCls: string) => { +export const useResetIconStyle = (iconPrefixCls: string, csp?: CSPConfig) => { const [theme, token] = useToken(); // Generate style for icons diff --git a/components/theme/util/genComponentStyleHook.ts b/components/theme/util/genComponentStyleHook.ts index 59800c5075..c7a0253cf2 100644 --- a/components/theme/util/genComponentStyleHook.ts +++ b/components/theme/util/genComponentStyleHook.ts @@ -3,6 +3,7 @@ import type { CSSInterpolation } from '@ant-design/cssinjs'; import { useStyleRegister } from '@ant-design/cssinjs'; import { useContext } from 'react'; import { ConfigContext } from '../../config-provider/context'; +import { genCommonStyle, genLinkStyle } from '../../style'; import { useResetIconStyle } from '../../config-provider/style'; import type { ComponentTokenMap, GlobalToken } from '../interface'; import type { UseComponentStyleResult } from '../internal';