Hi team,
I export function
import Config from 'react-native-config';
export const AuthenticateService = {
login(data) {
console.log('Config.API_VERSION', Config.API_VERSION);
}
};
=> Config.API_VERSION return undefined
BUT if I render in View it returns value.
How I can get value Config.API_VERSION in AuthenticateService
Can you help?
Thanks
Hello,
Do you add the line on android/app/build.gradle file as explain in Extra step for Android ?
I had the same problem.
For iOS, ReactNativeConfig.xcodeproj needs to be manually added to Libraries and libReactNativeConfig.a added to Build Phases -> Link Binary With Libraries.
This is because react-native link doesn't work well.
Most helpful comment
I had the same problem.
For iOS, ReactNativeConfig.xcodeproj needs to be manually added to Libraries and libReactNativeConfig.a added to Build Phases -> Link Binary With Libraries.
This is because react-native link doesn't work well.