added a temporary env variable in react app, how to remove it?

Viewed 23

added temporary env variable using the command ($env:REACT_APP_NOT_SECRET_CODE = "abcdef") -and (npm start) based on https://create-react-app.dev/docs/adding-custom-environment-variables/ doc. According to doc, it is supposed to live only for that shell session. But when I restart the app again with just npm start - the variable still exists. How to remove this?

1 Answers

Adding an answer to this in case other folks wind up here and don't see the comments.

The issue here is that restarting the application and restarting the shell are two different things.

To clear out these custom environmental variables, close and restart the shell session, not just the node app.

Related