DEV Community

Discussion on: How to dynamically change your React Environment variables without re-building

Collapse
ledpup profile image
ledpup

That npx command you run - npx react-inject-env set - with the environment variables before the command, e.g., REACT_APP_COLOR=black REACT_APP_TEXT="Black Background" npx react-inject-env set...

Is that a Bash command? Can this be reworked into a Windows cmd? I've tried a few ways but don't see how to do it.

Collapse
eslynn profile image
lynn Author • Edited on

Hello! Sorry for the late reply. I've updated the instructions to show how to use it with Windows!

# for windows
set REACT_APP_COLOR=navy&& set REACT_APP_TEXT=Navy Background&& npx react-inject-env set
Enter fullscreen mode Exit fullscreen mode