Search code examples
reactjsherokucreate-react-appbuildpack

Pickup config change from Heroku with mars/create-react-app-buildpack


I currently have a create-react-app deployed on my Heroku server, and I'm using the mars/create-react-app-buildpack.

I would like to be able to change the Heroku REACT_APP_ config variables on Heroku, and have them used in the React App.

Heroku REACT_APP_ config settings

Right now, they config variables are only picked up once when I call git push heroku master which means I need to redeploy for the config settings to change.

Has someone been able to find a workaround for this?


Solution

  • I found out this is already handled by @mars/create-react-app-buildpack with runtimes configuration variables.

    You can use them in your react app as follows: https://github.com/mikehanssen/create-react-app-buildpack#runtime-configuration.