Skip to content

Commit

Permalink
fix(provider): support antd csp (#8855)
Browse files Browse the repository at this point in the history
Co-authored-by: Jacob_Ye <[email protected]>
  • Loading branch information
CodeYHJ and Jacob_Ye authored Nov 14, 2024
1 parent 143ac69 commit f64090a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/provider/src/useStyle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export function useStyle(

const { theme: provideTheme } = useContext(ProProvider);

const { getPrefixCls } = useContext(AntdConfigProvider.ConfigContext);
const { getPrefixCls, csp } = useContext(AntdConfigProvider.ConfigContext);

// 如果不在 ProProvider 里面,就用 antd 的
if (!token.layout) {
Expand All @@ -128,6 +128,7 @@ export function useStyle(
theme: provideTheme!,
token,
path: [componentName],
nonce: csp?.nonce,
},
() => styleFn(token as ProAliasToken),
),
Expand Down

0 comments on commit f64090a

Please sign in to comment.