const [array,setArray] = useState([]); Push value at the end: setArray(oldArray => [...oldArray,newValue] ); Push value at the start: setArray(oldArray => [newValue,...oldArray] );