diff --git a/packages/provider/src/index.tsx b/packages/provider/src/index.tsx index 2eec8fef20c5..b0daf4428b4a 100644 --- a/packages/provider/src/index.tsx +++ b/packages/provider/src/index.tsx @@ -279,7 +279,7 @@ export const ConfigProviderWrap: React.FC> = ({ children, autoClearCache = false, }) => { - const { locale } = useContext(AntdConfigProvider.ConfigContext); + const { locale, getPrefixCls } = useContext(AntdConfigProvider.ConfigContext); const token = useToken?.(); // 如果 locale 不存在自动注入的 AntdConfigProvider const Provider = locale === undefined ? AntdConfigProvider : React.Fragment; @@ -322,7 +322,9 @@ export const ConfigProviderWrap: React.FC> = ({ ); if (proProvide.isDeps) return provide; - return
{provide}
; + return ( +
{provide}
+ ); }} ); diff --git a/tests/layout/__snapshots__/demo.test.ts.snap b/tests/layout/__snapshots__/demo.test.ts.snap index 869025588c67..8b259eab167a 100644 --- a/tests/layout/__snapshots__/demo.test.ts.snap +++ b/tests/layout/__snapshots__/demo.test.ts.snap @@ -12813,7 +12813,7 @@ exports[`layout demos 📸 renders ./packages/layout/src/demos/collapsedShowTitl exports[`layout demos 📸 renders ./packages/layout/src/demos/config-provider.tsx correctly 1`] = `