Axios Error 1:- Store the data inside array;
Let's suppose we have an object array with lots of the objects inside that array in the nested object, to store all the data of the array inside the state just use
setData([...till the nested object])
follow these images:-
In the above image we data. And inside data, We have another data. In second data we have an array with some objects. To store this object into and array just do simple things.
setData([...response.data.data])
Everything is explained in the below image.
Note:- we have another way to store data in a list that is
setUserData(response.data.data)
When we have multiple urls inside an array, we do axios.all(); see below example
In the above image we have multuple url in urls array at line no 19;
To pass all urls one by one we do axios.all request; if You face any situations like this you can refer this example.