Hi,
I just upgraded an existing app to RN 0.46.4 and React 16.0.0-alpha.12 and React-Native-i18n 2.0.2 and I'm seeing undefined is not an object (evaluating 'RNI18n.languages') during launch when running the app for iOS ( unlike the testing issue #99 ).
RNI18n is imported in index.ios.js and used immediately, so I'm wondering if something needs to happen before (react-native-i18n).languages will be available...
// index.ios.js
import I18n from 'react-native-i18n';
const locale = I18n.locale.substr(0, 2); // --> error undefined is not an object (evaluating 'RNI18n.languages')
Thanks!
After building from XCode this vanished (before I had only tried it through the command line...) ... so closing this issue again. Sorry for the confusion.
This happened to me again. Simply this: import I18n from 'react-native-i18n'; caused it.
Hi there, I'm having the same issue.
@felixdivo what did you write instead of the "import I18n from 'react-native-i18n':" to prevent the error?
Well, this might not be a solution for you, but we were still evaluating what library to use. So we simply switched to that one: https://github.com/stefalda/ReactNativeLocalization. It has a fairly similar and straight forward syntax and so far works fine for us.
I am suffering this problem too. (but only Android)
rm -rf ./node_modules, updating npm, restart packager, remove packages.lock ..
I followed everything in doc, but always fails with Undefined is not an object (evaluating 'RNI18n.languages')
@AlexanderZaytsev Would you please consider reopening the issue? Thank you.
Most helpful comment
This happened to me again. Simply this:
import I18n from 'react-native-i18n';caused it.