diff --git a/components/config-provider/index.tsx b/components/config-provider/index.tsx
index 3ad1017b1..8705ecb9c 100644
--- a/components/config-provider/index.tsx
+++ b/components/config-provider/index.tsx
@@ -27,8 +27,7 @@ import {
import { useProviderSize } from './SizeContext';
import { useProviderDisabled } from './DisabledContext';
import { createTheme } from '../_util/cssinjs';
-import { useDesignTokenProvider } from '../theme/internal';
-import { toReactive } from '../_util/toReactive';
+import { DesignTokenProvider } from '../theme/internal';
export type {
ConfigProviderProps,
@@ -235,7 +234,6 @@ const ConfigProvider = defineComponent({
},
};
});
- useDesignTokenProvider(toReactive(memoTheme));
const validateMessagesRef = computed(() => {
// Additional Form provider
let validateMessages: ValidateMessages = {};
@@ -257,9 +255,12 @@ const ConfigProvider = defineComponent({
useProviderDisabled(componentDisabled);
const renderProvider = (legacyLocale: Locale) => {
+ let childNode = shouldWrapSSR.value ? wrapSSR(slots.default?.()) : slots.default?.();
+ if (props.theme)
+ childNode = {childNode};
return (
- {shouldWrapSSR.value ? wrapSSR(slots.default?.()) : slots.default?.()}
+ {childNode}
);
};