I've a .env file:
REACT_APP_API_KEY=1234567
Then I added that to my component:
const API_kEY = process.env.REACT_APP_API_KEY;
console.log("Key is", API_KEY);
const URL = "http://myapi.com?appid=${API_KEY}"
I get API key in console successfully, but I get this error:
dashboard.js:26 GET http://myapi.com?appid=${API_KEY} 401 (Unauthorized)
How can I make URL to get the API KEY?