I'm trying to add each element of an array I pull from an API into an existing state in react. How would I be able to pull out each element and add it to state?
Here is what I know how to do. It doesn't work in this situation because the new data is an array.
state= [{}, {}, {}]
newData= [{}, {}, {}]
setState([...state, newData])