when I try to run the code below in chrome console it works and I get alert in the browser but when I try to run the same code inside react native environment, I get an error instead: "TypeError: Network Request Failed".
makeRequest(){
fetch('http://localhost:3000/')
.then(response => response.json())
.then(data => alert(data))
.catch(e => alert(e));
}
render() {
return(
<View style = {styles.main}>
{setTimeout(()=>this.makeRequest(),1000);}
</View>
)
}