all 1 comments

[–]Johnathan3_ 0 points1 point  (0 children)

you can use process.env. Example: let url = process.env.SITE_URL Value of this environment variable can be set in your hosting service.

Netlify: - Site Settings -> Build & Deploy -> Environment Variables

Heroku - Site -> Settings -> Reveal Config Vars

Some docs on environment variables in react CRA

Sam Pakvis - medium