1const [prevState, setState] = React.useState([]);
2
3setState(prevState => [...prevState, 'somedata'] );
1handleClick() {
2 this.setState(prevState => {
3 return {
4 count: prevState.count + 1
5 }
6 })
7 }