React - create-react-app
Useful links
Env variables in create-react-app
- Variables can be defined in your shell or in a
.env
file at the project root. - Only variables starting with
REACT_APP_
are imported. - Imported values are placed in
process.env
, for exampleprocess.env.REACT_APP_SECRET_CODE
. - More in this article
Staging
There are only development and production env in create-react-app
. You can simulate a new env as an env variable REACT_APP_ENV=staging
.