Push-Method-in-React-Hooks-Usestate

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

setTheArray(theArray => [...theArray, newElement]);
Lovely Locust