react-native-dotenv
react-native-dotenv copied to clipboard
Converting string true/false to boolean value
For example, I have two variables:
ABC = true
XYZ = false
And in the code, I want to have a convenient check, like this:
import { ABC, XYZ } from 'react-native-dotenv';
if (XYZ) {
// Always true
}
if (XYZ === 'true') {
// Therefore it is necessary to do, then OK
}
Because otherwise string false will be counted as true, and the check will always be true.
Is it possible to do something?
This is handled by dotenv
(which is a dependency), check this out https://github.com/motdotla/dotenv/issues/51
@wachunei Yes but dotenv doesn't work with RN