score:2

For the latest releases, you don't need the dotenv module any more. Environment variables are available with react-scripts@0.2.3 and higher. According to Create React App docs:

Environment Variables is available with react-scripts@0.2.3 and higher.

So the only thing you need to do is to create the .env file and put your variables in it with the prefix REACT_APP_{your variable name}, and then you can use any variable in your code using:

process.env.REACT_APP_{your variable name}

Related Query

More Query from same tag