If you want to use environment variables in React, you need to prefix them with
When you start your React app, you will use
export REACT_APP_API_URL=http://localhost:4200 && yarn run start then.
In your code, you can read the variable's content with
It took me two days to figure out that you need to use the prefix, so maybe this advice will safe you some time.