diff --git a/components/config-provider/index.tsx b/components/config-provider/index.tsx index 5aa3f6f43f..b7e2482760 100644 --- a/components/config-provider/index.tsx +++ b/components/config-provider/index.tsx @@ -1,4 +1,4 @@ -import { Theme as V5Theme } from '@ant-design/cssinjs'; +import { createTheme } from '@ant-design/cssinjs'; import IconContext from '@ant-design/icons/lib/components/Context'; import { FormProvider as RcFormProvider } from 'rc-field-form'; import type { ValidateMessages } from 'rc-field-form/lib/interface'; @@ -251,7 +251,7 @@ const ProviderChildren: React.FC = props => { // ================================ Dynamic theme ================================ const memoTheme = React.useMemo(() => { const { algorithm, token, ...rest } = mergedTheme || {}; - const themeObj = algorithm ? new V5Theme(algorithm) : undefined; + const themeObj = algorithm ? createTheme(algorithm) : undefined; return { ...rest, diff --git a/components/theme/index.tsx b/components/theme/index.tsx index 0dca5e299b..130ae7221f 100644 --- a/components/theme/index.tsx +++ b/components/theme/index.tsx @@ -1,5 +1,5 @@ -import type { CSSInterpolation } from '@ant-design/cssinjs'; -import { Theme, useCacheToken, useStyleRegister } from '@ant-design/cssinjs'; +import type { CSSInterpolation, Theme } from '@ant-design/cssinjs'; +import { createTheme, useCacheToken, useStyleRegister } from '@ant-design/cssinjs'; import React from 'react'; import version from '../version'; import type { @@ -20,7 +20,7 @@ import genComponentStyleHook from './util/genComponentStyleHook'; import getArrowStyle from './util/placementArrow'; import statisticToken, { merge as mergeToken, statistic } from './util/statistic'; -const defaultTheme = new Theme(defaultDerivative); +const defaultTheme = createTheme(defaultDerivative); export { resetComponent, diff --git a/package.json b/package.json index e59f166581..84ee5d3617 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ ], "dependencies": { "@ant-design/colors": "^6.0.0", - "@ant-design/cssinjs": "^0.0.0-alpha.34", + "@ant-design/cssinjs": "^0.0.0-alpha.35", "@ant-design/icons": "^4.7.0", "@ant-design/react-slick": "~0.29.1", "@babel/runtime": "^7.18.3",