I'm trying to get the data from this API to show up and I cant for the life of me figure out a way for it to work. I can get the sol_keys to show up but that's it. My original thought would be "average temp" is something like {sol.AT.mx} and so on for the others but no go. Any help is much appreciated.
Here is the code:
const Weather = () => {
const { data, status } = useQuery("weather", fetchWeather);
console.log(data);
return (
<div>
<h2>Mars Weather</h2>
{status === "loading" && <div>Loading Data...</div>}
{status === "error" && <div>Error Fetching Data</div>}
{status === "success" && (
<div>
{" "}
{data.sol_keys.map((sol) => (
<div>Sol: {sol}</div>
<div>Average Temp: ??? </div>
<div>Wind Direction: ??? </div>
<div>Season: ??? </div>
))}
</div>
)}
</div>
);
};
Here is the what the API returns. API Response