previstate no uso
const [prevState, setState] = React.useState([]);
setState(prevState => [...prevState, 'somedata'] );
Salo Hopeless
const [prevState, setState] = React.useState([]);
setState(prevState => [...prevState, 'somedata'] );