react push to array from array of objects code example Example: add array of object to state react setTheArray(currentArray => [...currentArray, newElement])