Skip to content

Commit

Permalink
chore: Fix LocaleReceiver ts define
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Aug 22, 2020
1 parent 5a3bcee commit 40473cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/locale-provider/LocaleReceiver.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 40473cf

Please sign in to comment.