What does prevState do in React.js code example
Example 1: react prevstate
handleClick() {
this.setState(prevState => ({
isToggleOn: !prevState.isToggleOn
}));
}
Example 2: this.setstate prevstate
this.setState(prevState => ({ n: !prevState.n }))