2
buildings : [record1, record2, ...]
과 같은 서버에서 응답을 받았으므로 해당 응답에서 배열 만 가져 오려고합니다. Promise에서 배열을 가져 오는 방법은 무엇입니까? 나는/일부 비동기 시도 일을 기다리고 있지만, 나는이 코드를 사용하는 방법을 이해하지 못했다 않은 :react-native fetch async/응답 필터 대기
setupImpagination() {
....
fetch(pageOffset, pageSize, stats) {
return fetch(`http://localhost:3000/api/building/all?skip=${pageOffset}&limit=${pageSize}`)
.then(response => {
console.log('response.json() => ',response.json());
response.json()
})
.catch((error) => {
console.error(error);
});
}
});
}
대단히 고맙습니다. 비동기/대기 솔루션이 나에게 도움이되었습니다. 나는'fetch' 전에'async'를 추가해야만했습니다. – imalik8088