ignite-bowser
ignite-bowser copied to clipboard
Not clear on how to use environment variables
What's going on?
In the Ignite Bowser Expo template, there is an .env
file. I can’t see that it is used in the boilerplate. It also says in the comment:
# This is an example where you can store your environment variables.
# It uses react-native-dotenv as a babel transform.
#
# Then just do this to import them:
# import { API_URL } from ‘react-native-dotenv’
The instructions on how to use environment variables doesn't seem to be up-to-date because react-native-dotenv
isn't included in package.json
.
Is this just some old code still laying around, or should the comment include some instructions that a user should add that package? Or should that package be included in the boilerplate?
Since the boilerplate now supports Expo, maybe expo-constants
should be the preferred way of using environment variables. https://docs.expo.io/guides/environment-variables/
At the same time, the folder app/config/
contains files that allows a user to use those as some kind of environment variables.
Steps to reproduce
- Generate a new app
- Follow the instructions in
.env
- Error
ignite doctor
results:
System
platform darwin
arch x64
cpu 8 cores Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
directory bowser /Users/andreasolsson/Code/bowser
JavaScript
node 12.18.2 /Users/andreasolsson/.asdf/installs/nodejs/12.18.2/bin/node
npm 6.14.5 /Users/andreasolsson/.asdf/installs/nodejs/12.18.2/bin/npm
yarn 1.22.4 /Users/andreasolsson/.yarn/bin/yarn
Ignite
ignite-cli 3.5.2 /Users/andreasolsson/.asdf/installs/nodejs/12.18.2/.npm/bin/ignite
ignite src build /Users/andreasolsson/.config/yarn/global/node_modules/ignite-cli/build
navigation react-navigation
generators
component ignite-bowser
model ignite-bowser
navigator ignite-bowser
screen ignite-bowser
createdWith 3.5.2
boilerplate ignite-bowser
boilerplateVersion 5.3.0
Android
java 14.0.2 /usr/bin/java
android home - undefined
iOS
xcode 11.6
cocoapods 1.9.3 /usr/local/bin/pod
Maybe this is related #194 #274 ?
Any update? I am using Ignite Flame and wondering the same thing. Instead of accessing the dev menu to toggle storybook UI (which doesn't appear to be working), I'd rather just pass a variable to expo start --storybook=true to run the story ok.