pass locale as key to IntlProvider to force a rerender on locale change

See docs: https://github.com/yahoo/react-intl/wiki/Components#dynamic-language-selection
This commit is contained in:
ochicf 2018-09-15 22:15:31 +02:00
parent 2d4889abcc
commit 41bcb84d0c

View file

@ -85,6 +85,7 @@ class App extends PureComponent {
return (
<IntlProvider
locale={this.getLocale()}
key={this.getLocale()}
messages={Strings[this.getLocale()]}
>
<div className={`locale-${this.getLocale()}`}>