prestate in usestate
const [prevState, setState] = React.useState([]);
setState(prevState => [...prevState, 'somedata'] );
Salo Hopeless
const [prevState, setState] = React.useState([]);
setState(prevState => [...prevState, 'somedata'] );