From c74e7f91d0dcaeca82be24d1c2e397fd48459d9c Mon Sep 17 00:00:00 2001 From: Grapedge Date: Tue, 3 Aug 2021 15:25:42 +0800 Subject: [PATCH] fix(next): add the default language when the language is undefined (#1939) --- packages/next/src/form/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/next/src/form/index.tsx b/packages/next/src/form/index.tsx index fbd40abc60e..dc7b0e25dbe 100644 --- a/packages/next/src/form/index.tsx +++ b/packages/next/src/form/index.tsx @@ -25,7 +25,8 @@ export const Form: React.FC = ({ previewTextPlaceholder, ...props }) => { - const lang = (ConfigProvider as any).getContext()?.locale?.momentLocale + const lang = + (ConfigProvider as any).getContext()?.locale?.momentLocale ?? 'zh-CN' useMemo(() => { const validateLanguage = getValidateLocaleIOSCode(lang) setValidateLanguage(validateLanguage)