react dynamic settings

Solutions on MaxInterview for react dynamic settings by the best coders in the world

showing results for - "react dynamic settings"
Camilla
18 May 2019
1The easiest solution for me turned out to be to include a tag in my index.html. This gets minified during the NPM build but it does not get bundled with the other javascript so it can easily be replaced with another file at deploy time. My config.js looks like this:
2
3config = {
4    "title": "Application Title",
5    "envName": "LocalDev",
6    "URL": "localhost:8090"
7}
8Then inside my react components they're accessible by using:
9
10const config = window.config;
11alert("Application branding title is: " + config.title);
12