In REACT, I am fetching data from an API and want to present key field from that in a drop down menu for user to select one of the values. API returns an array and has a key field.
//get data api - Global data
const [globalData, setGlobalData] = useState();
const [dataLoading, setDataLoading] = useState(false);
useEffect(() => { async function fetchGlobalData()
{ setDataLoading(true)
const url = "api.thevirustracker.com/free-api?global=stats";
const apiResponse = await fetch(url)
const dataFromAPI = await apiResponse.json()
...
How can I build a drop down list from one of the key fields of the array.