const [theArray, setTheArray] = useState(initialArray); setTheArray(theArray => [...theArray, newElement]);