Answers for "create-react-app enviroment variables"

2

create react app .env

// Create .env file 
REACT_APP_VAR_NAME=value

// Use this variable
process.env.REACT_APP_VAR_NAME
Posted by: Guest on August-03-2021
0

create-react-app enviroment variables

process.env.NODE_ENV gives you either "development" or "production" or "test"
When you run npm start it is equal to develpment
When you run npm run build it is equal to production
When you run npm test it is equal to test
Posted by: Guest on December-24-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language