From 36009ad11714fec20ec3e59cd082759c39d128b5 Mon Sep 17 00:00:00 2001 From: dominik-zeglen Date: Wed, 4 Sep 2019 16:01:26 +0200 Subject: [PATCH] Add fallback locale --- src/components/Locale/Locale.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Locale/Locale.tsx b/src/components/Locale/Locale.tsx index 600b5e54e..0a83cc640 100644 --- a/src/components/Locale/Locale.tsx +++ b/src/components/Locale/Locale.tsx @@ -151,10 +151,12 @@ function getMatchingLocale(): Locale { } } } + + return undefined; } const LocaleProvider: React.FC = ({ children }) => { - const [locale] = React.useState(getMatchingLocale()); + const [locale] = React.useState(getMatchingLocale() || defaultLocale); return (