Changing values from config file after building the reactApp

837 Views Asked by At

Is it possible to give parameters using .config file to reactApp after running npm run build I am fetching data thorugh a url in reactApp. I need to deploy only the built file.

After giving npm run build, can't I change the values through config file like in Java. Or else re-building the app is the only solution?

1

There are 1 best solutions below

2
On

process.env.SOME_VARIABLE is used to provide an environment variable. You can initialize this variable with build app command. Check more on create-react-app repo docs