The result string from the fetch is strangely not written via setStat in the stat variable, but when I output the result in the console inside fetch then that is the expected correct value (online), do you have an idea why useState "stat" remains empty?
const [stat, setStat] = React.useState("");
...
fetch("https://123.321:4040/app/requestStat", requestOptions)
.then(response => response.text())
.then(result => console.log("Fetch response:" + result)) // <- correct value
.then(result => setStat(result))
.catch(error => console.log('error', error));
console.log("stat value: " + stat); // <- empty value ??
...
// console.log output
stat value: Eva.js:177:18
Fetch response:online Eva.js:173:34