Recently I am studying ReactJS.
I want to set a global configuration variable such as SERVER_IP_ADDR.
So, when I ask the server for an API (get / post) as Ajax,
I would like to use this global configuration variable in ReactJS.
I usually create a global variable in JavaScript,
Just import it and use it anywhere.
/js/config.js
var SERVER_IP_ADDR
/js/main.js
<script src="/js.config.js"></script>
and like this
<script>
function request() {
url = SERVER_IP_ADDR;
}
</script>
Can not I set up this structure in ReactJS?