I am trying to assign a variable after fetch in reactjs, it is not being assigned after the fetch for the code below:
var apiBase = '';
fetch('/AppSettings/GetSettings')
.then(response => { return response.text() })
.then(data => {apiBase = data; console.log("Within Call:" + apiBase); })
.catch(err => {console.log("Error :" + err) });