Add fallback locale

This commit is contained in:
dominik-zeglen 2019-09-04 16:01:26 +02:00
parent 192c67bda4
commit 36009ad117

View file

@ -151,10 +151,12 @@ function getMatchingLocale(): Locale {
} }
} }
} }
return undefined;
} }
const LocaleProvider: React.FC = ({ children }) => { const LocaleProvider: React.FC = ({ children }) => {
const [locale] = React.useState(getMatchingLocale()); const [locale] = React.useState(getMatchingLocale() || defaultLocale);
return ( return (
<IntlProvider <IntlProvider