diff --git a/components/locale-provider/LocaleReceiver.tsx b/components/locale-provider/LocaleReceiver.tsx index 925727d39d..a11377d26d 100644 --- a/components/locale-provider/LocaleReceiver.tsx +++ b/components/locale-provider/LocaleReceiver.tsx @@ -61,8 +61,9 @@ export function useLocaleReceiver( const componentLocale = React.useMemo(() => { const locale = defaultLocale || defaultLocaleData[componentName || 'global']; const localeFromContext = componentName && antLocale ? antLocale[componentName] : {}; + return { - ...(typeof locale === 'function' ? locale() : locale), + ...(typeof locale === 'function' ? (locale as Function)() : locale), ...(localeFromContext || {}), }; }, [componentName, defaultLocale, antLocale]);