Skip to content

Commit 845d76b

Browse files
committed
fix: resolve bug of undefined locale
1 parent b5c14c9 commit 845d76b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/providers/YupLocaleProvider.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ const YupLocaleProvider: FC<YupLocaleProviderProps> = ({
1313
children,
1414
}) => {
1515
if (languages[locale]) {
16-
yup.setLocale(languages[locale].yupLocale!);
16+
const yupLocale = languages[locale].yupLocale;
17+
if (yupLocale) {
18+
yup.setLocale(yupLocale);
19+
}
1720
}
1821

1922
return <>{children}</>;

0 commit comments

Comments
 (0)