Answer the question
In order to leave comments, you need to log in
Is it correct to get data from the API?
Hello. I fight half a day. Hope you! I'm building an application that receives data from the API
Essence The component that receives the data does not see it, but it exists.
The component wrapped in Consumer passes data to the child component, but the child component does not receive anything.
<ErrorBoundary>
<OpenServiceConsumer>
{(openService) => {
// console.log(`res ${openService.getArrival(selected.selected, 60)}`);
return (<FlightsTable data={openService.getArrival(selectedAirport.selectedAirport, 360)} />)}}
</OpenServiceConsumer>
</ErrorBoundary>
console.log(`props.data ${props.data}`);
[{"icao24":"484d10","firstSeen":1587929916,"estDepartureAirport":"GMMN","lastSeen":1587940304,"estArrivalAirport":"EHAM","callsign":"TFL8378 ","estDepartureAirportHorizDistance":1307,"estDepartureAirportVertDistance":24,"estArrivalAirportHorizDistance":1374,"estArrivalAirportVertDistance":26,"departureAirportCandidatesCount":0,"arrivalAirportCandidatesCount":1},....]
Answer the question
In order to leave comments, you need to log in
aplikukha, prilozha, react, well, I didn’t get to the basics of js
ps for harmful young grandfathers: "one of the foundations of modern js"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question