Não consigo ler a API. Obtenho o seguinte erro:
Possible Unhandled Promise Rejection (id: 0): TypeError: Network request failed onerror@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:28005:31 dispatchEvent@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:34133:31 setReadyState@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:33217:33 _didCompleteResponse@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:33044:29 emit@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:3420:42 _callFunction@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2748:49 http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2470:31 __guard@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2702:15 callFunctionReturnFlushedQueue@http://localhost:8081/index.bundle?platform=android&dev=true&minify=false:2469:21 callFunctionReturnFlushedQueue@[native code]
const [fotos, setFotos]= useState([])
useEffect(()=>{//so retorna função
const lerFotos = async()=>{
const fotosHTTP = await fetch("http://localhost:3030/feed");
const fotosJson = await fotosHTTP.Json();
setFotos(fotosJson)
}
lerFotos();
},[])