react prev state and next state code example
Example: prevstate in react
handleClick() {
this.setState(prevState => {
return {
count: prevState.count + 1
}
})
}
handleClick() {
this.setState(prevState => {
return {
count: prevState.count + 1
}
})
}