Browse Source

chore: Fix LocaleReceiver ts define

pull/26339/head
zombiej 4 years ago
parent
commit
40473cfa19
  1. 3
      components/locale-provider/LocaleReceiver.tsx

3
components/locale-provider/LocaleReceiver.tsx

@ -61,8 +61,9 @@ export function useLocaleReceiver<T extends LocaleComponent>(
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]);

Loading…
Cancel
Save