Open abdulkabirpatel opened 3 years ago
maybe try to change it to this
I18n.locale = languageCode.toString()
I think you are sending a non-string value to a function that only accepts strings if my fix didn't work you can pass your asyncStorage value to a function and then make it a string, then pass it to a state then use it in I18n.locale.
Also if you are using the i18njs library it's i18n.locale
not I18n.locale
I am getting error [Thu Dec 10 2020 23:42:05.669] ERROR TypeError: locale.split is not a functi on. (In 'locale.split("-")', 'locale.split' is undefined)
whenever I add
const langCheck=async()=>{
const languageCode = await AsyncStorage.getItem(language);
I18n.locale = languageCode; }