From b55dd17d33b55faf294f154205354aab8f4bd5b2 Mon Sep 17 00:00:00 2001 From: Debabrata Nayak Date: Sat, 19 Oct 2019 01:44:43 +0530 Subject: [PATCH] localStorage bug fixed --- src/App.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/App.js b/src/App.js index e3f5436..6ff52d8 100644 --- a/src/App.js +++ b/src/App.js @@ -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 (