score:0

const maketworequests = async () => {
 try{
   const firstresponse = await axios.get(first_url);
   if(firstresponse.status === 200){
     const firstresponsedata = firstresponse.data;
     const secondresponse = await axios.get(second_url);
      
     if(secondresponse.status === 200){
       const secondresponsedata = secondresponse.data;
     }
   }
 }
 catch(error){
   console.log(error)
 }
}
maketworequests()

firstresponsedata and secondresponsedata can be state variables instead of const for better access throughout the component


Related Query

More Query from same tag