Push-method-in-reacct-hooks-Usestate
const [theArray, setTheArray] = useState(initialArray);
setTheArray(theArray => [...theArray, newElement]);
Lovely Locust
const [theArray, setTheArray] = useState(initialArray);
setTheArray(theArray => [...theArray, newElement]);