I am attempting to map thhrough some response.data that I fetched using axios. the API data looks like this.... Yes I am aware you cannot map through an object. I figured out that this isnt an array, its an object and thats why map must not be working right? So how would I be able to display the data I want out of this object then in the return statement? This is what I have so far.... ps. All off the youtube videos and articles ive found on stackoverflow dont seem to be specific enough in answering this question. And the youtube videos seem to only ever cover mapping through response.data that comes in the from of an Array.
import React, { useEffect, useState } from "react";
import axios from "axios";
export default function App() {
const [info, setInfo] = useState([]);
useEffect(() => {
axios
.get("https://api.coindesk.com/v1/bpi/currentprice.json")
.then((response) => setInfo(response.data));
});
return (
<div>
{info.map((item) => (
<p>{item.description}</p>
))}
</div>
);
}```
JSON response
```{time: Object, disclaimer: "This data was produced from the CoinDesk Bitcoin Price Index (USD). Non-USD currency data converted using hourly conversion rate from openexchangerates.org", chartName: "Bitcoin", bpi: Object}```