functional setstate where you use the prev state code example Example: this.setstate prevstate this.setState(prevState => ({ n: !prevState.n }))