set up react environment create-react-app code example
Example 1: update create react app
npm install react-scripts@latest
Example 2: 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