Skip to content

Commit

Permalink
localStorage bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Debabrata Nayak authored and Debabrata Nayak committed Oct 18, 2019
1 parent 35f02e0 commit b55dd17
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ const messages={
function App() {
const [currentLocale, setCurrentLocale] = useState(defaultLocale);
const onChangeLanguage = (e) => {
console.log("selected locale",e.target.value);
setCurrentLocale(e.target.value);
localStorage.setItem('locale',currentLocale)
}
const selectedLocale = e.target.value;
setCurrentLocale(selectedLocale);
localStorage.setItem('locale',selectedLocale)
}
return (
<IntlProvider locale={currentLocale} messages={messages[currentLocale]}>
<div className="App">
Expand Down

0 comments on commit b55dd17

Please sign in to comment.