push-method-in-react-hooks-ourestate

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

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