I am hoping somebody can help me with what I'm trying to do.
So I'm fetching an API endpoint that returns sets of data which is fine, but what What I like to do is to use all campaignid parameter values and make an api call one-by-one to retrieve each campaignid value's results so it would use each id from the campaignid and makes an api call, obviously the end point for the other call would be different. Just wondering how do I do that dynamically
import { useState, useEffect } from "react";
const url = "https://6271dd6bc455a64564b8b6b6.mockapi.io/AP1/REST/Numberofsubmissons";
export default function App() {
const [data, setData] = useState([]);
console.log(data);
useEffect(() => {
fetch(url)
.then((response) => response.json())
.then((data) => setData(data))
}, []);
return (
<>
<code>{JSON.stringify(data)}</code>
</>
);
}
fetch(url)and this returns what exactly? Is your question how to then take thisdatavalue and make a bunch of new requests? Can you edit to include a minimal reproducible example for what you are trying to do? What are the subsequent API requests you want to make?