I have below method where am making a service call using whatwg-fetch. setstate does not work with IE browser. It works fine with other browsers.
After i enclosed setstate within settimeout it works good in IE.
Not sure this timeout will affect once its deployed in prod servers and time delay for response gets increased. Please suggest me with an ideal solution for this issue. Thanks!
fetch("/local/addThings").then(res => res.json())
.then(
(result) => {
setTimeout(() => {
this.setState({
value: "edit",
items: result
});
}, 1000);
}
)
.catch(error => console.error('Error:', error));
}```