Hello guys, i've got this wonderful lib and it works fine except during test
I'm using jest, and i've go this weird error.
TypeError: Cannot read property 'getLanguages' of undefined
at Object.<anonymous> (node_modules/react-native-i18n/index.js:12:45)
at Object.<anonymous> (src/i18n/index.js:1:849)
at Object.<anonymous> (src/features/login/index.js:5:11)
The app works tho.
@AlexanderZaytsev
Same here, one every two runs.
+1
+1

Why does this happen?
@AlexanderZaytsev
@giantss Try replacing the function with (don't forget to clean the packager cache):
export const getLanguages = () => RNI18n.getLanguages()
Does it fixes the problem?
+1
pod install failed, but I did not see the error log on the console.Here are my steps:
1, Created a new project
2, npm install react-native-i18n --save
3, react-native link
4, react-native run-ios/run-android
I did not configure Automatic setup with Cocoapods In ios, it is recommended to update the document, to prevent the user with trouble.
@zoontek
@giantss What version of RN are you using?
@zoontek 0.49.5
@zoontek - with your change it's working. I guess we need a pull request :)
@compojoom feel free to do it :)
@zoontek - I see that we already have one
https://github.com/AlexanderZaytsev/react-native-i18n/pull/153
New version is out https://github.com/AlexanderZaytsev/react-native-i18n/releases/tag/v2.1.0 !
Most helpful comment
153 ,I am now working for both android and ios. I was not able to work before because of the operationAutomatic setup with Cocoapods. I guess it may be because
pod installfailed, but I did not see the error log on the console.Here are my steps:
I did not configure Automatic setup with Cocoapods In ios, it is recommended to update the document, to prevent the user with trouble.
@zoontek