Open marcelomorgado opened 5 years ago
@marcelomorgado Can we close this?
Maybe, the current solution just imports the config file parameters to a singleton object. With one of the packages above (like dotenv), the config is imported automagically and the parameters are exposed as global vars to the application.
Ah ok - we can keep it open then and continue to ponder it
A note: The current approach (reading config from a file manually) isn't working well on the tasit
app if ProviderFactory
is used (direct or indirectly) outside of a function. The solution used here should address that issue too.
Refs: https://github.com/tasitlabs/tasit/pull/269#discussion_r274048159 Related to: https://github.com/tasitlabs/tasit/issues/278
config
anddotenv
modules use somenode.js
APIs that are unavailable onreact-native
environment. For now, we are using programmatically config.See more: https://github.com/expo/expo/issues/83 https://medium.com/@skiptomyhue/setting-up-environment-variables-for-react-native-builds-b66a2576a218 https://medium.com/@tacomanator/environments-with-create-react-app-7b645312c09d https://github.com/zetachang/react-native-dotenv https://www.reactnative.guide/6-conventions-and-code-style/6.3-environment-variables.html https://stackoverflow.com/questions/33117227/setting-environment-variable-in-react-native https://facebook.github.io/create-react-app/docs/adding-custom-environment-variables https://stackoverflow.com/questions/33117227/setting-environment-variable-in-react-native/37823398 https://github.com/manoj-nama/expo-env https://medium.com/@peterpme/environment-variables-in-expo-using-release-channels-4934594c5307